#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

#1560 in Algorithms

Download history 8/week @ 2024-02-17 19/week @ 2024-02-24 1/week @ 2024-03-02 42/week @ 2024-03-30 12/week @ 2024-04-06

54 downloads per month

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