This function creates unique identifier (IDs) using sample()
.
generate_identifier(id_length = 6, n = 1, chars = c(0:9, letters[1:6]))
Arguments
- id_length
character length of ID
- n
number of IDs to generate
- chars
characters to use for generation, defaults to hexadecimal characters (0-9 and a-f)
Examples
generate_identifier(8)
#> [1] "b2062bd6"
generate_identifier(6, 3)
#> [1] "66ede2" "150b36" "3dadf6"