Sigid
Sigil + ID β Zero-dependency unique identifiers.
Table of Contents
Features
- π° Three Layers: Core β Flexible β Enterprise. Choose only the abstraction level you need.
- β‘ Zero Dependencies: The
Corecrate has zero external dependencies and works natively inno_std. - π― 26 Characters: Encoded in human-readable Crockford Base32 format.
- π¦ 128 Bits: Layout consists of Timestamp (48) + Worker ID (16) + Counter (14) + Random (50).
- π Chronologically Sortable: Lexicographically sortable by time of creation (database index friendly).
- π Thread-Safe: Lock-free architecture utilizing atomic operations for extreme throughput.
- π WASM Ready: Works out-of-the-box in browser environments via
getrandom/js. - π Type-Safe: Wrapped in a specialized
SigId26type instead of unsafe raw strings. - β
Checksum Protection: Optional validation using ISO 7064 Mod 37,36 with auto-correction for human typing typos (
Oβ0,I/Lβ1). - π¨ Highly Customizable: Fine-tune length, custom alphabets, static/dynamic text prefixes, and raw layout components.
Architecture
Bit Layout (128 bits)
ββββββββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββ
β Timestamp (48) β Worker ID (16) β Counter (14) β Random (50) β
ββββββββββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββ
β
βΌ
Crockford Base32 (26 characters)
β
βΌ
"01GJ8X9Z000000000000000000"
Directory Structure
sigid/
βββ core/ # Zero-dependency, no_std core state machine
βββ flexible/ # Layout customizer (alphabets, prefixes, checksums)
βββ enterprise/ # Distributed cluster-scale engine with cloud scaling
Quick Start
Add the unified umbrella crate to your Cargo.toml:
[]
= "1.0.0"
1. Simple (Core)
use ;
2. Flexible (Flexible)
use ;
3. Industrial (Enterprise)
use ;
Module Specification
| Module | Description | Dependencies | Environment |
|---|---|---|---|
sigid-core |
Minimalistic, ultra-fast core machine | 0 | no_std / WASM |
sigid-flexible |
Custom alphabets and text prefix builder | Optional (serde) |
std / no_std |
sigid-enterprise |
Cloud-native clustered engine | Optional (uuid) |
std |
Layer Installation
Core-Only (Absolute minimalism):
[]
= "1.0.0"
Customization and Serialization features:
[]
= { = "1.0.0", = ["serde"] }
Enterprise Clustered Infrastructure:
[]
= { = "1.0.0", = ["full"] }
License
This project is dually licensed under your choice of:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
Translations
If you like this project, please give it a star on GitHub: github.com/dmitrymarison/sigid