UUIDgenerate: Generate UUID

Description Usage Arguments Value Author(s) Examples

View source: R/uuid.R

Description

UUIDgenerate generates a new Universally Unique Identifier. It can be either time-based or random.

Usage

1
UUIDgenerate(use.time = NA, n = 1L)

Arguments

use.time

logical, if TRUE then time-based UUID is generated, if FALSE then a random UUID is generated, if NA then random one is generated if a sufficiently reliable source of random numbers can be found, otherwise a time-based UUID is generated.

n

integer, number of UUIDs to generate. Must be in [0, 2^31)

Value

String, UUID in lowercase form.

Author(s)

Simon Urbanek, based on libuuid by Theodore Ts'o.

Examples

1
2
3
4
5
UUIDgenerate()
UUIDgenerate(TRUE)
UUIDgenerate(FALSE)
## see if the randomness is any good
length(unique(UUIDgenerate(n=1000)))

Example output

[1] "9f6e9305-b384-4b04-81d1-0fba50568b9f"
[1] "440e34b8-36f7-11eb-991c-fa163ea53983"
[1] "1cddb4b5-b389-41c4-b902-ecfe557dbaee"
[1] 1000

uuid documentation built on Feb. 27, 2020, 1:07 a.m.

Related to UUIDgenerate in uuid...