nist-rand 0.1.0

A high-assurance, FIPS 140-3 and NIST SP 800-90A/B/C compliant Cryptographically Secure Pseudorandom Number Generator (CSPRNG) with multi-source entropy blending.
Documentation
use std::env;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path;

fn main() {
    println!("cargo:rerun-if-changed=build.rs");

    if env::var("CARGO_FEATURE_BUILD_SEPARATOR").is_ok() {
        let out_dir = env::var("OUT_DIR").unwrap();
        let dest_path = Path::new(&out_dir).join("build_separator.bin");
        let mut f = File::create(&dest_path).unwrap();

        let mut buf = [0u8; 64];
        // Read 64 bytes from /dev/urandom
        let mut urandom = File::open("/dev/urandom").expect("build.rs: /dev/urandom unavailable — cannot generate BUILD_SEPARATOR");
        urandom.read_exact(&mut buf).expect("build.rs: failed to read 64 bytes from /dev/urandom");

        f.write_all(&buf).unwrap();
    }
}