Package 'RcppUUID'

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

Help Index


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. UUIDs generation are parallelized by OpenMP.

Author(s)

Maintainer: Artem Klevtsov [email protected] (ORCID)

See Also

Useful links:


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)

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", ""))