Expand description
An implementation of fuzzyhash/ssdeep hash algorithm. The original CTPH paper describes how this fuzzy hash is computed.
§Examples
Build a fuzzy hash from blocks of data, like a stream:
use fuzzyhash::FuzzyHash;
use std::io::Read;
let mut file = std::fs::File::open("/path/to/my/file").unwrap();
let mut fuzzy_hash = FuzzyHash::default();
loop {
let mut buffer = vec![0; 1024];
let count = file.read(&mut buffer).unwrap();
fuzzy_hash.update(buffer);
if count < 1024 {
break;
}
}
fuzzy_hash.finalize();
println!("Fuzzy hash of data: {}", fuzzy_hash);
Hash some data:
use fuzzyhash::FuzzyHash;
let mut buffer = Vec::new();
buffer.push(0xde);
buffer.push(0xad);
buffer.push(0xbe);
buffer.push(0xef);
// ...
println!("Fuzzy hash of data: {}", FuzzyHash::new(buffer));
Modules§
Structs§
- Fuzzy
Hash - Hasher for fuzzy algorithm
Enums§
- Modes
- Hashing modes
Functions§
- fuzzyhash⚠
- Returns the fuzzy hash of arbitrary data. This method provides better FFI compatibility.
- fuzzyhash_
compare ⚠ - FFI Compatible fuzzy hash comparisons.
Type Aliases§
- Result
- Result of fuzzy hash operations