#hash #bidirectional #feistel

bidirectional_hash

A simple implementation of a bidirectional hash function using a Feistel network

1 unstable release

0.1.0 Jun 17, 2024

#17 in #bidirectional

MIT license

5KB
117 lines

bidirectional hash

A simple bidrectional hash implementation based on this Psuedo Encrypt algorithm, which is a Feistel network, with support up to 128 bit numbers.

Usage

cargo add bidirectional_hash
use bidirectional_hash::hash;

fn main() {
    let x: u64 = 123456789;
    let h = hash(x.into()); // Input::U64(x)
    assert_eq!(hash(h), x);
}

No runtime deps