simhash

Function simhash 

Source
pub fn simhash<T, const N: usize>(data: &[T]) -> T
where T: Num + FromPrimitive + WrappingSub + AddAssign + SubAssign + BitAnd<Output = T> + BitOrAssign + Shl<Output = T> + Copy,
Expand description

Computes the SimHash of a set of data. This function is generic over all numeric types.

Note that:

  1. size_of(T) must equal to N bits
  2. the hash size must match the input bit width

Reimplementation of: https://github.com/acoustid/chromaprint/blob/516e3b31c7fa6e822035ea3b3e31f9c7f51ef4b6/src/simhash.cpp#L8