nanorand
A tiny, fast, zero-dep library for random number generation.
0.8.0
73M downloads/mo
#976 most downloaded on crates.io
Absolucy/nanorand-rs
What this package is like to depend on
Last release 1 years ago
08 Jun 2025
Ships unpredictably
gaps range from 2 weeks to 3.3 years
Some releases are documented
notes for 5 of 17 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
18 releases · first in 2020
0 releases in the last 12 months
see the full history below
Release timeline
18 releases · Sep 2020 to Jun 2025Releases
latest 18-
0.8.008 Jun 2025Release notes
Open source →What's Changed
- Fix lower bound for signed
generate_rangefunction by @smvilar in #38 - Add OpenBSD support by @n1000 in #40
- Implement Fisher-Yates shuffle by @jklott in #42
- Fix SmallCrush by @jklott in #44
- Add FreeBSD support. by @MikaelUrankar in #46
- fix: underlying issue of generate_range of signed integers being off by 1 by @StT191 in #48
- feat: add chacha counter initialization by @xpe in #51
- Fix signature of RtlGenRandom and update entropy correspondingly by @cakarsubasi in #53
- Update getrandom to 0.3 by @robert3005 in #54
New Contributors
- @smvilar made their first contribution in #38
- @n1000 made their first contribution in #40
- @jklott made their first contribution in #42
- @MikaelUrankar made their first contribution in #46
- @StT191 made their first contribution in #48
- @xpe made their first contribution in #51
- @cakarsubasi made their first contribution in #53
- @robert3005 made their first contribution in #54
Full Changelog: 0.7.0...0.8.0
- Fix lower bound for signed
-
0.7.009 Mar 2022Release notes
Open source →Changelog (from 0.6.1)
- Reworked the API heavily
- The
Rngtrait now uses const generics for output length, rather than an associated type - Added
Rng::fill_bytes, and reworkedRandomGenimplementations to use it. Rng::reseedwas move into the newSeedableRngtrait.- All RNGs now have a
Debugimplementation
- The
- Completely reworked the C API.
- Added
BufferedRng, a wrapper around anRngthat buffers output, and will use buffered output rather than wasting perfectly good random bytes. - Set MSRV at Rust 1.56.0
- Rust 2021 is used.
- Removed nanorand-py (not like anyone used it anyways)
- Fixed signed integer generation!
- Clarified in the docs that
RandomRangewill panic with an invalid range.
- Reworked the API heavily
-
0.6.124 Jul 2021Release notes
Open source →Changelog
- Fixed an unsoundness in
TlsWyrandallowing for aliased mutable references.
- Fixed an unsoundness in
-
0.6.008 Jul 2021Release notes
Open source →This is the big one, folks! Breaking changes, obviously.
Changelog
- Renamed
RNGtoRng RandomGenwill no longer panic if lower > upper (#24)- Added
RandomGensupport for signed integers (#9) and floats (#20)RandomGenfor float will generate an float in the range of0 <= x <= 1
- Added
RandomRangesupport for signed integers (#9) - Fixed
RandomRangehaving weird in/exclusivity (#21) ChaChanow has a const generic of how many rounds it is. This speeds it up slightly.TlsWyRandis now reference-counted.- Added some unit tests to ensure that
RandomRangeworks properly.
- Renamed
-
0.5.230 Dec 2020Nothing published for this version
-
0.5.107 Dec 2020 -
0.5.003 Dec 2020 withdrawnNothing published for this version
-
0.4.423 Sep 2020Nothing published for this version
-
0.4.323 Sep 2020Nothing published for this version
-
0.4.222 Sep 2020Nothing published for this version
-
0.4.122 Sep 2020Nothing published for this version
-
0.4.019 Sep 2020Nothing published for this version
-
0.3.013 Sep 2020Nothing published for this version
-
0.2.110 Sep 2020Nothing published for this version
-
0.2.010 Sep 2020Nothing published for this version
-
0.1.110 Sep 2020Nothing published for this version
-
0.1.010 Sep 2020Nothing published for this version
-
0.0.006 Sep 2020Nothing published for this version