Generate UUIDs using the uuid package. This is simply a thin wrapper around uuid::UUIDgenerate that matches the interface in the rest of the ids package.

uuid(n = 1, drop_hyphens = FALSE, use_time = NA)

Arguments

n

number of ids to return. If NULL, it instead returns the generating function

drop_hyphens

Drop the hyphens from the UUID?

use_time

Passed through to UUIDgenerate as use.time.

Author

Rich FitzJohn

Examples

# Generate one id
uuid()
#> [1] "4561fd5a-e400-46f4-bd74-872907e76484"

# Or a bunch
uuid(10)
#>  [1] "fece28e1-f54c-4f50-8135-58f2eb0dbee6"
#>  [2] "913cf0ea-e617-4f10-822d-cd9c6aa0c8aa"
#>  [3] "d20f7d9a-5f39-407b-88e1-442ac0214cce"
#>  [4] "36529d38-a5a6-40c8-b9f9-254f74f031ba"
#>  [5] "6fd12862-f58b-4d52-af6d-ff966d277ef0"
#>  [6] "2b533eca-d45c-468c-826f-a00ae34a1c1f"
#>  [7] "9bf599e1-bb09-4ac3-8983-d706645561ef"
#>  [8] "9a4565f1-1b64-4101-a40d-346b315ca0bc"
#>  [9] "55d52047-c191-4df2-b0da-4c5ebb647feb"
#> [10] "de69f9b7-7589-4b52-90f6-91ae12943d1d"

# More in the style of random_id()
uuid(drop_hyphens = TRUE)
#> [1] "e5b0311f95c54bb7951edfcf7075c404"