Skip to main content

Crate tidyid

Crate tidyid 

Source
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§

InvalidIdFormatError
Error returned when a value does not follow the TidyID format.
InvalidIdLengthError
Error returned when an ID length is outside 3..=256.

Enums§

GenerateError
Error returned while generating an ID.
ValidationError
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 value follows the TidyID format.
tidyid
Generates an ID using fresh bytes from the platform CSPRNG.