Skip to contents

ID aliases are pseudorandom sequences of alphanumeric upper case characters where the letter "O" is not included for readability.. User has the option of providing a character vector of aliases to avoid using.

Usage

obfuscateId(id, size = 10L, existingIds = character(0L))

Arguments

id

character vector of IDs to be obfuscated (alias creation).

size

character length of each alias

existingIds

character vector of existing aliases to avoid duplication.

Value

A named character vector of aliases where the name is the original ID value.

Examples

library(nprcgenekeepr)
integerIds <- 1L:10L
obfuscateId(integerIds, size = 4L)
#>      1      2      3      4      5      6      7      8      9     10 
#> "YWIJ" "0QG1" "D5WU" "LQSG" "TCJH" "J6Q2" "5PCL" "0LX4" "4NN6" "X0W6" 
characterIds <- paste0(paste0(sample(LETTERS, 1L, replace = FALSE)), 1L:10L)
obfuscateId(characterIds, size = 4L)
#>     H1     H2     H3     H4     H5     H6     H7     H8     H9    H10 
#> "G6S5" "G108" "7JVD" "4L2J" "HTJG" "TUEI" "08D1" "83KX" "88LJ" "FLS7"