Crate rand_sfc

Source
Expand description

The rand_sfc crate is an implementation of Chris Doty-Humphrey’s Small Fast Counting PRNGs.

The SFC algorithms are not suitable for cryptographic uses but are very fast.

This crate provides:

  • sfc16
  • sfc32
  • sfc64

The sfc32 algorithm is implemented as Sfc32, and the sfc64 algorithm is implemented as Sfc64.

This crate supports version 4 of the SFC algorithms.

§Examples

use rand_sfc::{
    Sfc64,
    rand_core::{RngCore, SeedableRng},
};

let mut rng = Sfc64::seed_from_u64(0);
let x = rng.next_u64();
assert_eq!(x, 0x68ee_fb29_e2a4_f4ab);

Re-exports§

pub use rand_core;

Structs§

Sfc32
A sfc32 random number generator.
Sfc64
A sfc64 random number generator.