Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cryptogladi/file-hashing
Library for hashing files and folder
https://github.com/cryptogladi/file-hashing
Last synced: 9 days ago
JSON representation
Library for hashing files and folder
- Host: GitHub
- URL: https://github.com/cryptogladi/file-hashing
- Owner: CryptoGladi
- License: mit
- Created: 2022-11-03T15:41:37.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T11:34:40.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T11:29:31.825Z (5 months ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# file-hashing
This crate will help you easily get hash from **files** or **folders**
# Example
```rust
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](https://en.wikipedia.org/wiki/Don't_repeat_yourself) principle.
With this crate you can save a couple of hoursLicense: **MIT**