atomic-snowflake
Zero-Dependency Lock-Free Snowflake ID, ULID & RFC 9562 UUIDv7 Generators
Workspace Overview · API Docs · Agent Engineering Rules
Overview
Provides zero-dependency, lock-free monotonic 64-bit Snowflake ID (SnowflakeGenerator / SnowflakeId), 128-bit Crockford Base32 ULID (UlidGenerator / Ulid), and RFC 9562 UUIDv7 (UuidV7Generator / UuidV7) generators with clock-rollback protection and zero-allocation stack codecs.
This package is part of the ctares unified Rust 2024 workspace and follows the repository's strict module purity, formatting, and dependency-ordered release standards.
Installation & Quick Start
use *;
let sf: SnowflakeGenerator = new.expect;
let id: SnowflakeId = sf.next_id;
assert_eq!;
let ulid_gen: UlidGenerator = new;
let ulid: Ulid = ulid_gen.next_ulid;
assert_eq!;
let uuid_gen: UuidV7Generator = new;
let uuid: UuidV7 = uuid_gen.next_uuid;
assert_eq!;
License
This project is licensed under the MIT License. See the LICENSE file for details.