imohash

Crates.ioimohash
lib.rsimohash
version0.1.2
sourcesrc
created_at2023-08-14 13:58:18.402348
updated_at2024-08-28 01:05:52.866844
descriptionFast hashing for large files
homepage
repositoryhttps://github.com/hiql/imohash
max_upload_size
id944191
size1,132,790
hiql (hiql)

documentation

https://docs.rs/imohash

README

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

Commit count: 1

cargo fmt