https://github.com/rrchelbi/uuiz
Because every identity deserves a unique one. 🆔
https://github.com/rrchelbi/uuiz
blazingly-fast library module uuid zig
Last synced: 8 months ago
JSON representation
Because every identity deserves a unique one. 🆔
- Host: GitHub
- URL: https://github.com/rrchelbi/uuiz
- Owner: rrchelbi
- License: mit
- Created: 2025-08-20T21:02:36.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-01T19:49:50.000Z (10 months ago)
- Last Synced: 2025-10-07T13:28:42.524Z (9 months ago)
- Topics: blazingly-fast, library, module, uuid, zig
- Language: Zig
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# uuiz 🆔
**uuiz** - Because every identity deserves a unique one. 🆔
[](https://ziglang.org/)
[](LICENSE)
[](https://github.com/rrchelbi/uuiz/actions)
A lightweight, zero-dependency UUID library for Zig. Provides RFC 4122 compliant UUID generation, parsing, and manipulation with a focus on performance and type safety.
## Features
- ✅ **RFC 4122 Compliant** - Full support for UUID specification
- 🚀 **Zero Dependencies** - Only requires the Zig standard library
- 🔒 **Type Safe** - Strong typing throughout the API
## Installation
1. Run zig fetch:
```bash
$ zig fetch --save git+https://www.github.com/rrchelbi/uuiz#main
```
After this your `build.zig.zon` should look like this:
```zig
.{
// other attributes
// ...
.dependencies = .{
// other dependencies
// ...
.uuiz = .{
.url = "https://github.com/rrchelbi/uuiz?ref=main#...",
.hash = "1220...",
},
},
}
```
2. Add the module to your `build.zig`:
```zig
const uuiz = b.dependency("uuiz", .{
.target = target,
.optimize = optimize,
});
exe.addModule("uuiz", uuiz.module("uuiz"));
```
## Quick Start
```zig
const std = @import("std");
const uuiz = @import("uuiz");
pub fn main() !void {
const uuid = uuiz.v4.new();
std.debug.print("Generated v4 UUID: {}\n", .{uuid});
}
```
## API Reference
### Core Types
```zig
// Main UUID type (128 bits)
const UUID = u128;
// UUID versions
const Version = enum {
v1, // Time-based
v2, // DCE Security
v3, // MD5 hash
v4, // Random
v5, // SHA-1 hash
v6, // Ordered time-based
v7, // Unix timestamp-based
v8, // Custom
};
```
## Version Support
| Version | Status | Description |
|---------|--------|-------------|
| v1 | ✅ | Time-based |
| v2 | | DCE Security |
| v3 | | MD5 namespace-based |
| v4 | ✅ | Random (cryptographically secure) |
| v5 | | SHA-1 namespace-based |
| v6 | | Ordered time-based |
| v7 | | Unix timestamp-based |
| v8 | | Custom format |
## Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- RFC 4122 UUID specification
- Zig community for best practices
- Contributors and testers