neco-rand 0.1.0

Deterministic non-cryptographic random generators and stable bucket assignment
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented0 out of 10 items with examples
  • Size
  • Source code size: 10.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.72 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 50s Average build duration of successful builds.
  • all releases: 50s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • barineco/neco-crates
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • barineco

neco-rand

Deterministic non-cryptographic random generators and stable bucket assignment.

Use this crate for simulation, sampling, and deterministic cohort splitting. Use cryptographic key handling, secure nonces, and security-sensitive random generation in dedicated cryptographic random crates.

Features

  • SplitMix64 seed expansion
  • Xoroshiro128Plus deterministic PRNG
  • Stable bucket assignment from key + experiment + salt

Usage

use neco_rand::{bucket, SplitMix64, Xoroshiro128Plus};

let mut seeder = SplitMix64::new(42);
let seed = seeder.next_u64();

let mut rng = Xoroshiro128Plus::new(seed);
let value = rng.next_f64();

let bucket_index = bucket::assign_bucket(b"user-1", b"exp-a", b"salt", 100);

assert!((0.0..1.0).contains(&value));
assert!(bucket_index < 100);

API

Item Description
SplitMix64 Deterministic seed expansion and one-shot mixing
Xoroshiro128Plus Fast deterministic PRNG for non-cryptographic use
bucket Stable cohort assignment helpers

License

MIT