# 4.4BSD-Lite2 random number generator [![Crates.io License](https://img.shields.io/crates/l/bsd4random)](https://spdx.org/licenses/BSD-3-Clause.html) [![Crates.io Version](https://img.shields.io/crates/v/bsd4random.svg)](https://crates.io/crates/bsd4random) [![Crates.io MSRV](https://img.shields.io/crates/msrv/bsd4random?logo=rust&label=MSRV&labelColor=orange)](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html) [![Safe Rust](https://img.shields.io/badge/Rust-safe-brightgreen.svg)](https://www.rust-lang.org/policies/safety.html) [![dependency status](https://deps.rs/repo/gitlab/hsn10/bsd4random/status.svg)](https://deps.rs/repo/gitlab/hsn10/bsd4random) [![Documentation](https://docs.rs/bsd4random/badge.svg)](https://docs.rs/getopt3) [![Downloads](https://img.shields.io/crates/d/bsd4random)](https://crates.io/crates/bsd4random/versions) [![](https://tokei.rs/b1/gitlab/hsn10/bsd4random?category=code)](https://github.com/XAMPPRocky/tokei) 1. Zero dependencies. 1. Safe Rust. 1. Non viral BSD-3 License. 1. libc style API. 1. No built in support for harvesting randomness from entropy source. 1. No special multi threading support. You can Send generator to other thread or make thread local instance. ### Licensing This package uses [Revised BSD](https://spdx.org/licenses/BSD-3-Clause.html) license. Originally *4.4BSD-Lite2* got released under [BSD-4](LICENSE) but it got [relicensed](License.Change) 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 1. https://github.com/freebsd/freebsd-src/blob/releng/4.11/lib/libc/stdlib/rand.c 1. https://cvsweb.openbsd.org/src/lib/libc/stdlib/ 1. https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/rand.c 1. 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. 1. FreeBSD 5 replaced this algorithm with different one. 1. DragonFlyBSD merged FreeBSD change. 1. It is still in current NetBSD-10 source tree. 1. It is still in OpenBSD source tree. 1. Included in glibc-2.26