anano

Another nanoID implementation for nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.2.1
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-09-02 07:20

Authors

  • Jake Leahy

Installation

nimble install anano
choosenim install anano
git clone https://github.com/ire4ever1190/anano

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
anano - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.0 No

Source

Repository https://github.com/ire4ever1190/anano
Homepage https://github.com/ire4ever1190/anano
Registry Source nimble_official

README

Anano

Another nanoID implementation for Nim.

This implementation is based off of nim-neoid but - uses more compile time code to give massive speedups (This comes with the tradeoff though that you can't define options at runtime). - Only uses the nim standard library

Works on c, c++ and js backends

Main reason I built this was so I could learn how the ID was generated but also make it generate an array[byte] instead so I could better store it in a database for another project of mine

Warning I am not a security expert and this has not be vetted. Use this at your own risk

Usage

docs

import anano

let id = genNanoID()
echo id

Benchmarks

Time for generating 10000 elements

name ............................... min time      avg time    std dv   runs
anano .............................. 9.276 ms      9.442 ms    ±0.237   x525
nim-neoid ........................ 180.788 ms    186.523 ms    ±7.320    x27

(From benchmark.nim, compiled with -d:release)