rng

Wrapper over std/sysrand

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

Summary

Latest Version 0.3.0
License BSD-3-Clause
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • penguinite

Installation

nimble install rng
choosenim install rng
git clone https://codeberg.org/onbox/rng

OS Compatibility

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

Dependencies

Package Version Optional
nim >= 1.6.14 No

Source

Repository https://codeberg.org/onbox/rng
Homepage https://docs.penguinite.dev/rng/
Registry Source nimble_official

README

nim-rng

Very basic wrapper over std/sysrand, you might be able to use this as a somewhat cryptographically-secure drop-in replacement for std/random

Install using nimble: nimble install rng or nimble install https://codeberg.org/onbox/rng Documentation can be found here

Warning: std/sysrand has not been audited, and so it is possible that it might not actually be cryptographically secure. But, it also just wraps over common platform-specific cryptographically-secure random number generators so the chance that this is unsafe is small but it is a real chance. Decide for yourself whether or not this is worth the risk, if it isn't then consider using wrappers to OpenSSL or some other well-established cryptography library that offers a CSPRNG.

Special Thanks

Credit: The uuidv4 proc is based on on nim-uuid4 by Matt Cooper (@vtbassmatt on GitHub)