1 unstable release

0.9.0 Aug 2, 2024

#449 in Math

BSD-3-Clause

26KB
291 lines

4.4BSD-Lite2 random number generator

Crates.io License Crates.io Version Crates.io MSRV Safe Rust dependency status Documentation Downloads

  1. Zero dependencies.
  2. Safe Rust.
  3. Non viral BSD-3 License.
  4. libc style API.
  5. No built in support for harvesting randomness from entropy source.
  6. No special multi threading support. You can Send generator to other thread or make thread local instance.

Licensing

This package uses Revised BSD license.

Originally 4.4BSD-Lite2 got released under BSD-4 but it got relicensed as BSD-3. Advertising cause got removed. More info at: https://www.dragonflybsd.org/docs/developer/DragonFly_BSD_License/

Credits

This product includes software developed by the University of California, Berkeley and its contributors.

Upstream code

Code comes and is tested against 4.4BSD stdlib

  1. https://github.com/sergev/4.4BSD-Lite2/tree/master/usr/src/lib/libc/stdlib
  2. https://github.com/freebsd/freebsd-src/blob/releng/4.11/lib/libc/stdlib/rand.c
  3. https://cvsweb.openbsd.org/src/lib/libc/stdlib/
  4. https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/rand.c
  5. https://gitweb.dragonflybsd.org/dragonfly.git/tree/5daa25b05ec172803258b0c1f1148cadfccdba9e:/lib/libc/stdlib

History

  1. Its not clear yet in which BSD version this random number generator first appeared. Under investigation.
  2. FreeBSD 5 replaced this algorithm with different one.
  3. DragonFlyBSD merged FreeBSD change.
  4. It is still in current NetBSD-10 source tree.
  5. It is still in OpenBSD source tree.
  6. Included in glibc-2.26

No runtime deps