logo

Rust crates reviews

Cryptographically verifiable, distributed dependency reviews

crate: fastrand

https://lib.rs/crates/fastrand/

Add the last reviewed version to Cargo.toml / [dependencies]:

fastrand = "1.8.0"

Filter reviews clicking on the numbers in the summary.

Full column names in tooltip hints: rating Negative, rating Neutral, rating Positive, rating Strong, thoroughness, understanding, reviews count.

Neg
Neu
Pos
Str
tho
und
rev
16
16
4
4
4
4
4
4
4
4
crate version
rating
date
reviewer
thoroughness, understanding
fastrand 1.5.0
positive
2021-07-20
high, high

Generates random numbers using Wyrand algorithm (which is not
cryptographically secure, but ostensibly passes some popular tests — I didn't
verify that).

No unsafe, no dependencies other than std (except on WASM, where it pulls
in instant crate to get initial entropy).

By default, the generator is initialized from a hash of
std::time::Instant::now() and process ID. Good enough for a non-cryptographic
PRNG.

Interesting detail: if the thread-local storage has already been
de-initialized by we try to use it, the generator is initialized by a fixed
seed 0x4d595df4d0f33173. This constant is an initial state for PCG-XSH-RR,
which is an algorithm that previous versions of the crate used.

I verified that the algorithms match the documents they reference:

I also verified that the algorithms that generate floating-point numbers
indeed do what they're supposed to do: set sign to 0 (i.e. positive),
exponent to 127 (i.e. zero), then fill the fraction with random bits, and
subtracting 1.0 from the result to get [0; 1).

Also worth mentioning that the crate doesn't guarantee a specific algorithm,
so you shouldn't depend on a specific seed to always produce the same
results.

Recommended for non-cryptographic purposes that do not require
reproducibility.

fastrand 1.5.0
positive
2021-07-20
high, high

Generates random numbers using Wyrand algorithm (which is not
cryptographically secure, but ostensibly passes some popular tests — I didn't
verify that).

No unsafe, no dependencies other than std (except on WASM, where it pulls
in instant crate to get initial entropy).

By default, the generator is initialized from a hash of
std::time::Instant::now() and process ID. Good enough for a non-cryptographic
PRNG.

Interesting detail: if the thread-local storage has already been
de-initialized by we try to use it, the generator is initialized by a fixed
seed 0x4d595df4d0f33173. This constant is an initial state for PCG-XSH-RR,
which is an algorithm that previous versions of the crate used.

I verified that the algorithms match the documents they reference:

I also verified that the algorithms that generate floating-point numbers
indeed do what they're supposed to do: set sign to 0 (i.e. positive),
exponent to 127 (i.e. zero), then fill the fraction with random bits, and
subtracting 1.0 from the result to get [0; 1).

Also worth mentioning that the crate doesn't guarantee a specific algorithm,
so you shouldn't depend on a specific seed to always produce the same
results.

Recommended for non-cryptographic purposes that do not require
reproducibility.

© bestia.dev 2023, MIT License, Version: 2023.608.1636

Open source repository for this web app: https://github.com/bestia-dev/cargo_crev_web/