Random generation utilities for cryptographic purposes.
Provides secure random generation for keys, tokens, passwords, and timing-safe comparison.
Summary
Functions
Generates a random 256-bit key.
Generates a random hex string.
Generates a random password with configurable length and character sets.
Generates a random URL-safe token.
Timing-safe string comparison.
Functions
@spec generate_key() :: binary()
Generates a random 256-bit key.
@spec random_hex(non_neg_integer()) :: binary()
Generates a random hex string.
@spec random_password( non_neg_integer(), keyword() ) :: binary()
Generates a random password with configurable length and character sets.
@spec random_token(non_neg_integer()) :: binary()
Generates a random URL-safe token.
Timing-safe string comparison.