<div align="center">
# atomic-snowflake
**Zero-Dependency Lock-Free Snowflake ID, ULID & RFC 9562 UUIDv7 Generators**
[](https://crates.io/crates/atomic-snowflake)
[](https://docs.rs/atomic-snowflake)
[](https://www.rust-lang.org)
[](../LICENSE)
[Workspace Overview](../README.md) · [API Docs](https://docs.rs/atomic-snowflake/latest/) · [Agent Engineering Rules](../AGENTS.md)
</div>
---
## 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`](../README.md) unified Rust 2024 workspace and follows the repository's strict module purity, formatting, and dependency-ordered release standards.
## Installation & Quick Start
```sh
cargo add atomic-snowflake
```
```rust
use atomic_snowflake::*;
let sf: SnowflakeGenerator = SnowflakeGenerator::new(1).expect("valid node id");
let id: SnowflakeId = sf.next_id();
assert_eq!(id.node_id(), 1);
let ulid_gen: UlidGenerator = UlidGenerator::new();
let ulid: Ulid = ulid_gen.next_ulid();
assert_eq!(Ulid::parse(&ulid.to_string()).expect("valid ulid"), ulid);
let uuid_gen: UuidV7Generator = UuidV7Generator::new();
let uuid: UuidV7 = uuid_gen.next_uuid();
assert_eq!(uuid.version(), 7);
```
## License
This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.