1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! This crate will help you easily get hash from **files** or **folders**
//!
//! # Example
//!
//! ```no_run
//! use std::path::PathBuf;
//! use blake2::{Blake2s256, Digest};
//! use file_hashing::get_hash_file;
//!
//! 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**
pub
use DynDigest;
use Error as IOError;
use ErrorKind as IOErrorKind;
use Path;
pub use ;
pub use ;
const PAGE_SIZE: usize = 4096;
/// Information about progress
///
/// # Example
///
/// ```no_run
/// use file_hashing::ProgressInfo;
///
/// let value_files = 300;
/// let info = ProgressInfo::Yield(1); // Just use a function that accepts **progress**
///
/// match info {
/// ProgressInfo::Yield(done_files) => println!("done files {}/{}", done_files, value_files),
/// ProgressInfo::Error(error) => println!("error: {}", error),
/// }
/// ```