3 releases

0.1.2 Aug 28, 2024
0.1.1 Aug 27, 2024
0.1.0 Aug 14, 2023

#1783 in Algorithms

Download history 255/week @ 2024-08-23 36/week @ 2024-08-30 23/week @ 2024-09-13 17/week @ 2024-09-20 6/week @ 2024-09-27 1/week @ 2024-10-04

103 downloads per month

MIT license

145KB
241 lines

imohash

Fast hashing for large files

A rewritten version of imohash in Rust.

Usage

Add this to your Cargo.toml:

[dependencies]
imohash = "0.1"

then

use imohash::Hasher;

// Creates a new hasher using default sample parameters
let hasher = Hasher::new();
//or creates with custom sample parameters
let hasher = Hasher::with_sample_size_and_threshold(3, 45);

// Hashes a byte slice
let hash_value = hasher.sum("hello".as_bytes()).unwrap();

// Hashes a file
let hash_value = hasher.sum_file("samples/system.evtx").unwrap();

Algorithm

Consult the documentation for more information.

Misuses

Because imohash only reads a small portion of a file's data, it is not suitable for:

  • file verification or integrity monitoring
  • cases where fixed-size files are manipulated
  • anything cryptographic

The original project created by Jim Kalafut, check out https://github.com/kalafut/imohash

License: MIT

Dependencies