file-hashing

Crates.iofile-hashing
lib.rsfile-hashing
version0.1.2
sourcesrc
created_at2022-11-04 17:43:59.914932
updated_at2022-12-22 11:34:57.174045
descriptionLibrary for hashing files and folders
homepage
repositoryhttps://github.com/CryptoGladi/file-hashing
max_upload_size
id705326
size24,642
(CryptoGladi)

documentation

README

file-hashing

This crate will help you easily get hash from files or folders

Example

let path = PathBuf::from("/home/gladi/test-hashing.txt");

let mut hash = Blake2s256::new();
let result = get_hash_file(&path, &mut hash).unwrap();

assert_eq!(result.len(), 64); // Blake2s256 len == 64

P.S. If the examples from the documentation do not work, then you need to look at the unit tests

Motivation

Each time we write our own function to get the hash from a file or folder. We repeat ourselves and violate the DRY principle. With this crate you can save a couple of hours

License: MIT

Commit count: 12

cargo fmt