mirror of
https://github.com/Noratrieb/crypto-hype.git
synced 2026-01-15 17:45:03 +01:00
SHA-1
This commit is contained in:
parent
6d46c730b9
commit
5ff6bc24fa
6 changed files with 181 additions and 1 deletions
13
src/bin/sha1sum.rs
Normal file
13
src/bin/sha1sum.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::sha1::hash(&content);
|
||||
println!("{sum} {file}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue