std.salt

std

salt(length) -> salt

Generate a random binary salt string

Returns a string of length random bytes (default 16). The output is raw binary, NOT hex-encoded. Byte value 0x00 is excluded. Suitable for use as HMAC key material or a password-hashing salt.

Requires math.randomseed to have been called before use.