Expand description
Secrets that are made, not chosen, and what is kept of them.
Constants§
- SECRET_
CHARS - Characters of base64url text that 32 random bytes take.
Functions§
- generate
- Makes a secret:
prefixfollowed by 256 random bits as 43 URL-safe base64 characters. - hash
- What a secret is kept as: its SHA-256 as 64 lowercase hexadecimal characters.
- hash_
bytes - The SHA-256 of
bytesas 64 lowercase hexadecimal characters. - identifier
- Makes a random 128-bit identifier as 32 lowercase hexadecimal characters.
- is_hash
- Whether
valueis a SHA-256 digest ashashwrites it. - same
- Compares two strings in time that does not depend on where they differ.