Expand description
Structs§
- Generator
- ID generator as a pure state machine
- SigId26
- 26-character identifier in Crockford Base32 format
Enums§
- Error
- Error types
Constants§
- ALPHABET
- Crockford Base32 alphabet
- ALPHABET_
LOWER - Crockford Base32 alphabet (lowercase)
- COUNTER_
BITS - Counter bits (14 bits)
- COUNTER_
MAX - Maximum counter value (2^14 - 1) = 16383
- EPOCH
- Epoch: 2020-01-01 00:00:00 UTC (milliseconds)
- ID_
BYTES - ID length in bytes (128 bits)
- ID_
LENGTH - ID length in characters
- RANDOM_
BITS - Random bits (50 bits)
- RANDOM_
MAX - Maximum random value (2^50 - 1)
- TIMESTAMP_
BITS - Timestamp bits (48 bits)
- TIMESTAMP_
MAX - Maximum timestamp value (2^48 - 1)
- WORKER_
BITS - Worker ID bits (16 bits)
- WORKER_
MAX - Maximum worker ID value (2^16 - 1)
Functions§
- crc16
- Calculate CRC-16 for data
- decode_
crockford32 - Decode 26 Crockford Base32 characters to 16 bytes
- encode_
crockford32 - Encode 16 bytes to 26 Crockford Base32 characters
- iso7064_
checksum - Calculate ISO 7064 Mod 37,36 checksum (like ISBN)
Type Aliases§
- Result
- Result type for no_std compatibility