Crates.io | hash4lf |
lib.rs | hash4lf |
version | 0.1.0 |
source | src |
created_at | 2023-08-14 12:33:38.165802 |
updated_at | 2023-08-14 12:33:38.165802 |
description | Fast hashing for large files |
homepage | |
repository | https://github.com/hiql/hash4lf |
max_upload_size | |
id | 944125 |
size | 1,127,812 |
Fast hashing for large files
A rewritten version of imohash in Rust.
Add this to your Cargo.toml:
[dependencies]
hash4lf = "0.1"
then
use hash4lf::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();
Consult the documentation for more information.
Because hash4lf only reads a small portion of a file's data, it is not suitable for:
The original project created by Jim Kalafut, check out https://github.com/kalafut/imohash
License: MIT