Expand description
Secure, human-friendly identifiers with a fixed LLD rhythm.
tidyid uses the operating system CSPRNG directly, rejects biased random
values, and never falls back to a predictable source.
Structs§
- Invalid
IdFormat Error - Error returned when a value does not follow the TidyID format.
- Invalid
IdLength Error - Error returned when an ID length is outside
3..=256.
Enums§
- Generate
Error - Error returned while generating an ID.
- Validation
Error - Error returned by
ensure_valid_id.
Constants§
- DEFAULT_
LENGTH - Recommended default ID length.
- DIGITS
- Unambiguous digits used at every third position.
- LETTERS
- Unambiguous lowercase letters used at letter positions.
- LETTERS_
WITH_ UPPERCASE - Unambiguous uppercase and lowercase letters used when uppercase is enabled.
- MAX_
LENGTH - Largest supported ID length.
- MIN_
LENGTH - Smallest supported ID length.
Functions§
- ensure_
valid_ id - Validates a TidyID or returns an explicit length or format error.
- get_
id_ capacity - Returns the exact number of possible IDs for a length and character mode.
- get_
id_ entropy - Returns the entropy, in bits, for a length and character mode.
- is_
valid_ id - Returns whether
valuefollows the TidyID format. - tidyid
- Generates an ID using fresh bytes from the platform CSPRNG.