uuid | R Documentation |
This function generates one or more UUIDs (Universally Unique Identifiers).
By default, it generates Version 7 UUIDs, which are time-ordered and suitable
for use cases requiring efficient indexing and sorting by creation time.
Alternatively, random Version 4 UUIDs can be generated by setting usetime = FALSE
.
uuid(n = 1, uppercase = FALSE, usetime = FALSE)
n |
Integer. Number of UUIDs to generate. Default is |
uppercase |
Logical. If |
usetime |
Logical. If |
Version 7 UUIDs: These are time-ordered UUIDs based on the current timestamp in milliseconds
since the Unix epoch (1970-01-01 00:00:00 UTC
). They are ideal for scenarios requiring
chronological sorting or indexing.
Version 4 UUIDs: These are randomly generated UUIDs that do not depend on time, ensuring uniqueness through random hexadecimal values.
A character vector of UUIDs of length n
.
library(pliman)
# Generate a single UUID
uuid()
# Generate 5 UUIDs in uppercase
uuid(n = 3, uppercase = TRUE)
# Generate two random UUIDs
uuid(n = 2, usetime = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.