https://github.com/the-ticking-clockwork/nulid
A ULID implementation in Nim!
https://github.com/the-ticking-clockwork/nulid
ulid ulid-generator
Last synced: 1 day ago
JSON representation
A ULID implementation in Nim!
- Host: GitHub
- URL: https://github.com/the-ticking-clockwork/nulid
- Owner: The-Ticking-Clockwork
- Created: 2023-09-02T00:08:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T18:31:45.000Z (4 months ago)
- Last Synced: 2025-02-19T19:23:09.077Z (4 months ago)
- Topics: ulid, ulid-generator
- Language: Nim
- Homepage: https://the-ticking-clockwork.github.io/NULID/
- Size: 209 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NULID
This is an implementation of the [ULID](https://github.com/ulid/spec)
spec in Nim! This also supports the JS backend for ULID generation!This supports [`jsony`](https://github.com/treeform/jsony) and
[`debby`](https://github.com/treeform/debby) out of the box too!Random fun fact: I coded the initial code for ULID generation on my phone
via Termux!## Compile Flags
`-d:nulidInsecureRandom`: Uses `std/random` instead of `std/sysrand`.`-d:nulidNoLocks`: Disables any usage of locks within the program.
The JS backend automatically defines `-d:nulidNoLocks`.
## Usage
```nim
let gen = initUlidGenerator()
let ulid = gen.ulid()echo ulid
```