R/rbyte.R
rbyte.Rd
Generate random bytes from the platform-specific cryptographically secure pseudorandom number generator
rbyte(n, type = "chr")
A raw vector or a hexadecimal string
The method used for generating random values varies depending on the operating system (OS):
For macOS and BSDs: arc4random_buf()
For linux: syscall(SYS_getrandom())
For win32: BCryptGenRandom()
All these random number generators are internally seeded by the OS using entropy gathered from multiple sources and are considered cryptographically secure.
rbyte(16, type = "chr")
#> [1] "04cadb8d7ecf2c959bde2c3440ead4ce"
rbyte(16, type = 'raw')
#> [1] 10 65 f2 5c 9f cd 9b c6 9d 59 59 4a 9f 23 c2 c5