Unified interface for unique identifier generation.
Add to your deps.edn:
{:deps {com.vadelabs/uid {:mvn/version "RELEASE"}}}
Or with Leiningen, add to project.clj:
[com.vadelabs/uid "RELEASE"]
(require '[com.vadelabs.uid.interface :as uid])
;; UUID generation
(uid/v4) ; Random UUID
(uid/v7) ; Time-ordered UUID
;; Flake generation
(uid/flake) ; Returns Flake object
(uid/snowflake) ; Returns URL-safe string
uid/
├── interface.clj # Unified public API
├── uuid/ # RFC9562 UUID implementation
│ ├── interface.clj # UUID public API
│ ├── core.clj # Core UUID logic
│ ├── bitmop.clj # Bit manipulation
│ ├── clock.clj # Monotonic clock
│ └── ...
└── flake/ # Flake implementation
├── interface.clj # Flake public API
├── core.clj # Core Flake logic
├── impl.clj # Implementation details
└── nanoclock.clj # Nanosecond clock
This library was inspired by and references implementations from:
μ/log (mulog) by Bruno Bonacci - Flake implementation reference
clj-uuid by Dan Lentz - UUID implementation reference
We are grateful to these projects and their maintainers for their excellent work and open source contributions.
Copyright © 2025 Vade Labs
Distributed under the MIT License. See LICENSE for details.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |