arb_hash 0.1.9

Arbitrary block length hash function, including some other related and handy functions.
Documentation
//Returns the digest of an input byte array
// - input: some input byte array, could be the contents of a file, for example
// - length: don't use under 3 bytes, as the output is not well distributed
// - rounds: 1 round is sufficient, but 2 rounds *might* be better distributed

mod serial_digest;

#[cfg(not(feature = "parallel"))]
use crate::block::pad_block;
#[cfg(not(feature = "parallel"))]
use serial_digest::serial_arb_digest;

#[cfg(feature = "parallel")]
mod parallel_digest;

#[cfg(feature = "parallel")]
use parallel_digest::parallel_arb_digest;

#[no_mangle]
pub fn arb_digest(input: &[u8], length: usize, rounds: u64) -> Vec<u8> {
    #[cfg(feature = "parallel")]
    return parallel_arb_digest(input, length, rounds);
    #[cfg(not(feature = "parallel"))]
    return serial_arb_digest(&pad_block(input, length), 0, length, rounds);
}