Implementation of the Nilsimsa locality-sensitive hashing algorithm.
Compared to "traditional" hash functions (cryptographic or not), a small modification to the input does not substantially change the resulting hash. This crate contains the Nilsimsa utility to calculate Nilsimsa hash digests, as well as a compare function for given digests.
let mut hasher = Nilsimsa::new(); hasher.update("test string"); let digest = hasher.digest(); assert_eq!( digest, "42c82c184080082040001004000000084e1043b0c0925829003e84c860410010" );
Utility to calculate Nilsimsa hash digests for arbitrarily long string inputs. See the crate-level documentation for an example of use.
Compare two hex digests with a Hamming distance calculation. Returns an