#algorithm #locality-sensitive

nightly nilsimsa

Implementation of the Nilsimsa locality-sensitive hashing algorithm

3 unstable releases

0.2.0 Oct 30, 2020
0.1.1 Oct 26, 2020
0.1.0 Oct 26, 2020

#1675 in Algorithms

MIT license

17KB
232 lines

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.

Usage

let mut hasher = Nilsimsa::new();
hasher.update("input string");
hasher.update("more strings");
let digest = hasher.digest();

lib.rs:

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

Dependencies

~22KB