[][src]Crate nilsimsa

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();



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 i16 in the range [-128, 128] representing the similarity of the two input digests, where -128 is most dissimilar and 128 is most similar, or equal. The input strings must be of the same length.