Title: | Generating Universally Unique Identificators |
---|---|
Description: | Provides functions to generating a vector of Universally Unique Identifiers (UUID). Used implementation from the Boost C++ library. Supported random (version 4) and name (version 5) UUIDs. |
Authors: | Artem Klevtsov [aut, cre] |
Maintainer: | Artem Klevtsov <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1.1 |
Built: | 2024-10-30 03:29:42 UTC |
Source: | https://gitlab.com/artemklevtsov/rcppuuid |
Provides functions to generating a vector of Universally Unique Identifiers (UUID). Used implementation from the Boost C++ library. Supported random (version 4) and name (version 5) UUIDs. UUIDs generation are parallelized by OpenMP.
Maintainer: Artem Klevtsov [email protected] (ORCID)
Useful links:
Report bugs at https://gitlab.com/artemklevtsov/rcppuuid/-/issues
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.
uuid_generate_name(x, ns = "x500dn")
uuid_generate_name(x, ns = "x500dn")
x |
Character vector. |
ns |
Namespace string. Allowed values: dns, url, oid, x500dn. |
Character vector with UUIDs.
This function generates valid uuids for the NA
and empty strings.
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Name%20Generator
# generate name UUIDs uuid_generate_name(c("one", "two"))
# generate name UUIDs uuid_generate_name(c("one", "two"))
Function generates nil uuids.
uuid_generate_nil(n = 1L)
uuid_generate_nil(n = 1L)
n |
Number of generated UUIDs. |
Character vector with UUIDs.
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Nil%20Generator
# generate nil UUIDs uuid_generate_nil(2)
# generate nil UUIDs uuid_generate_nil(2)
Function generates uuids using operating system provided entropy.
uuid_generate_random(n = 1L)
uuid_generate_random(n = 1L)
n |
Number of generated UUIDs. |
Character vector with UUIDs.
https://www.boost.org/doc/libs/1_72_0/libs/uuid/doc/uuid.html#Random%20Generator
# generate random UUIDs uuid_generate_random(2)
# generate random UUIDs uuid_generate_random(2)
Function validates uuids.
uuid_validate(x)
uuid_validate(x)
x |
Character vector. |
Logical vector.
# 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", ""))
# 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", ""))