Type: | Package |
Title: | Generating Universally Unique Identificators |
Version: | 1.2.0 |
Date: | 2025-02-12 |
Description: | Using the efficient implementation in the Boost C++ library, functions are provided to generate vectors of 'Universally Unique Identifiers (UUID)' from R supporting random (version 4), name (version 5) and time (version 7) 'UUIDs'. The initial repository was at https://gitlab.com/artemklevtsov/rcppuuid. |
URL: | https://github.com/eddelbuettel/rcppuuid |
BugReports: | https://github.com/eddelbuettel/rcppuuid/issues |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Depends: | R (≥ 3.1.0) |
Imports: | Rcpp |
Suggests: | tinytest, uuid, microbenchmark |
LinkingTo: | Rcpp, BH (≥ 1.87.0-1) |
Encoding: | UTF-8 |
NeedsCompilation: | yes |
RoxygenNote: | 7.3.2 |
Packaged: | 2025-02-12 13:49:05 UTC; edd |
Author: | Artem Klevtsov |
Maintainer: | Dirk Eddelbuettel <edd@debian.org> |
Repository: | CRAN |
Date/Publication: | 2025-02-12 14:30:02 UTC |
Generating Universally Unique Identificators
Description
Provides functions to generating a vector of Universally Unique Identifiers (UUID) using the implementation from the Boost C++ library. Supports random (version 4), name (version 5) and time-based (version 7) UUIDs. UUIDs generation is parallelized by OpenMP.
Author(s)
Maintainer: Dirk Eddelbuettel edd@debian.org (ORCID)
Authors:
Artem Klevtsov a.a.klevtsov@gmail.com (ORCID)
See Also
Useful links:
Report bugs at https://github.com/eddelbuettel/rcppuuid/issues
Generate UUIDs Version 5
Description
Function generates name-based uuid is derived from content in a namespace. A uuid with identical content shall yield the same uuid. Hashing algorithm is SHA1.
Usage
uuid_generate_name(x, ns = "x500dn")
Arguments
x |
Character vector. |
ns |
Namespace string. Allowed values: dns, url, oid, x500dn. |
Value
Character vector with UUIDs.
Note
This function generates valid uuids for the NA
and empty strings.
References
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Name%20Generator
Examples
# generate name UUIDs
uuid_generate_name(c("one", "two"))
Generates Nil UUIDs
Description
Function generates nil uuids.
Usage
uuid_generate_nil(n = 1L)
Arguments
n |
Number of generated UUIDs. |
Value
Character vector with UUIDs.
References
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Nil%20Generator
Examples
# generate nil UUIDs
uuid_generate_nil(2)
Generate UUIDs Version 4
Description
Function generates uuids using operating system provided entropy.
Usage
uuid_generate_random(n = 1L)
Arguments
n |
Number of generated UUIDs. |
Value
Character vector with UUIDs.
References
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Random%20Generator
Examples
# generate random UUIDs
uuid_generate_random(2)
Generate UUIDs Version 7
Description
This function generates time-based uuids using operating system provided entropy. Note that this requires Boost 1.86 or later.
Usage
uuid_generate_time(n = 1L)
Arguments
n |
Number of generated UUIDs. |
Value
Character vector with UUIDs generated under specification v7.
References
https://www.boost.org/doc/libs/release/libs/uuid/
Examples
# generate random UUIDs
uuid_generate_time(2)
Validate UUIDs
Description
Function validates uuids.
Usage
uuid_validate(x)
Arguments
x |
Character vector. |
Value
Logical vector.
Examples
# validate UUIDs
uuid_validate(uuid_generate_random(2))
uuid_validate(uuid_generate_nil(2))
uuid_validate(uuid_generate_name(c("one", "two")))
uuid_validate(c("a", ""))