mod hasher;
pub mod seed;
mod stream;
mod vperm;
#[cfg(feature = "std")]
use std::collections::{HashMap as StdHashMap, HashSet as StdHashSet};
use fearless_simd::Level;
pub use hasher::{IBuildHasher, IHasher};
use seed::{DetectLevel, hash_xof_with, hash128_with, hash256_with};
pub use stream::Stream;
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub type HashMap<K, V> = StdHashMap<K, V, IBuildHasher>;
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub type HashSet<T> = StdHashSet<T, IBuildHasher>;
#[must_use]
#[inline]
pub fn hash32_with_level(data: &[u8], level: Level) -> u32 {
hash64_with_level(data, level) as u32
}
#[must_use]
#[inline]
pub fn hash64_with_level(data: &[u8], level: Level) -> u64 {
hash128_with_level(data, level) as u64
}
#[must_use]
#[inline]
pub fn hash128_with_level(data: &[u8], level: Level) -> u128 {
hash128_with::<true>(data, 0, level)
}
#[must_use]
#[inline]
pub fn hash256_with_level(data: &[u8], level: Level) -> [u8; 32] {
hash256_with::<true>(data, 0, level)
}
#[inline]
pub fn hash_xof_with_level(data: &[u8], out: &mut [u8], level: Level) {
hash_xof_with::<true>(data, 0, out, level);
}
#[must_use]
#[cfg_attr(not(debug_assertions), inline(always))]
#[cfg_attr(debug_assertions, inline)]
pub fn hash32(data: &[u8]) -> u32 {
hash64(data) as u32
}
#[must_use]
#[cfg_attr(not(debug_assertions), inline(always))]
#[cfg_attr(debug_assertions, inline)]
pub fn hash64(data: &[u8]) -> u64 {
hash128(data) as u64
}
#[must_use]
#[cfg_attr(not(debug_assertions), inline(always))]
#[cfg_attr(debug_assertions, inline)]
pub fn hash128(data: &[u8]) -> u128 {
hash128_with::<true>(data, 0, DetectLevel)
}
#[must_use]
#[cfg_attr(not(debug_assertions), inline(always))]
#[cfg_attr(debug_assertions, inline)]
pub fn hash256(data: &[u8]) -> [u8; 32] {
hash256_with::<true>(data, 0, DetectLevel)
}
#[inline]
pub fn hash_xof(data: &[u8], out: &mut [u8]) {
hash_xof_with::<true>(data, 0, out, DetectLevel);
}