mirror of
https://github.com/Noratrieb/crypto-hype.git
synced 2026-01-15 01:25:03 +01:00
md5sum
This commit is contained in:
parent
8627450ca8
commit
6d46c730b9
2 changed files with 24 additions and 6 deletions
13
src/bin/md5sum.rs
Normal file
13
src/bin/md5sum.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fn main() {
|
||||
for file in std::env::args().skip(1) {
|
||||
match std::fs::read(&file) {
|
||||
Err(err) => {
|
||||
eprintln!("error reading {file}: {err}")
|
||||
}
|
||||
Ok(content) => {
|
||||
let sum = crypto_hype::hashes::md5::hash(&content);
|
||||
println!("{sum} {file}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue