FuncPerm
A no_std Rust library for cycle-walking functional permutations on
[0 . . n).
The FuncPerm structure provides, given n ≤ m, a pseudorandom
permutation of [0 . . n) by taking a bijection on [0 . . m) and
applying cycle walking to restrict the result to [0 . . n), that is,
by applying the bijection repeatedly until the result is in [0 . . n).
The library provides built-in bijections based on MurmurHash3-like mixing functions.
Examples
use murmur;
// Create a permutation of [0..100) with seeds (0, 0)
let perm = murmur;
// Every element maps to a unique element in [0..100)
let y = perm.get;
assert!;
You can also supply a custom bijection:
use FuncPerm;
let perm = new;
assert!;