Generates cryptographically random bytes and returns them as a standard Base64 string.
Useful for generating salts and nonces that need to be transmitted or stored as strings.
Number of random bytes to generate.
Base64-encoded random bytes.
const salt = randomBytesB64(16); Copy
const salt = randomBytesB64(16);
Generates cryptographically random bytes and returns them as a standard Base64 string.
Useful for generating salts and nonces that need to be transmitted or stored as strings.