Crate perfect_rand

source ·
Expand description

A port of the Blackrock cipher used in Masscan to Rust.

Its original purpose is efficiently randomizing the order of port scans without having to put every possible target in memory and shuffling.

Original code.

Example

//! Print 10 random Ipv4 addresses.


let randomizer = PerfectRng::from_range(2u64.pow(32));
for i in 0..10 {
    let randomized_ip = Ipv4Addr::from(randomizer.shuffle(i) as u32);
    println!("{randomized_ip:?}");
}

Structs