| Crates.io | hashstream |
| lib.rs | hashstream |
| version | 0.1.0 |
| created_at | 2025-08-20 00:45:32.260882+00 |
| updated_at | 2025-08-20 00:45:32.260882+00 |
| description | A simple utility to hash stdin and return results on stdout |
| homepage | https://github.com/davidsenk/hashstream |
| repository | https://github.com/davidsenk/hashstream |
| max_upload_size | |
| id | 1802713 |
| size | 59,353 |
A combined streaming hasher.
Hashstream is designed for needing multiple different hash types from a single stream / file simultaneously.
Hashstream does not perform any file IO on its own, it only reads and writes to stdio. You must pipe | or < redirect input to hashstream for processing.
Useful for coordinating systems that provide different hashtypes for stored blobs.
All hash types and library usage has associated tests, verify operation with cargo test
dd if=/dev/zero bs=4M count=250 status=progress | hashstream --sha256
hashstream --all < /home/user/somefile.dat
Usage: hashstream [OPTIONS]
Options:
--all Enable all hash types, can not be used with any other hash type flag [DEFAULT]
--sha256 SHA2-256
--sha3-256 SHA3-256
--sha1 SHA1
--crc32-iso CRC_32_ISO_HDLC
--crc32-posix CRC_32_CKSUM
--crc32-xfer CRC_32_XFER
--blake256 Blake2b256
--blake512 Blake2b512
--blake3 Blake3
--md5 MD5
-h, --help Print help
-V, --version Print version
Or, as a library within your own code (see main.rs)
use hashstream::{CRC32TYPE, HashType, Hashes};
~~~
let hash_types = [
HashType::CRC32(CRC32TYPE::CKSUM),
HashType::CRC32(CRC32TYPE::ISO),
HashType::CRC32(CRC32TYPE::XFER),
HashType::SHA256,
HashType::SHA3_256,
HashType::BLAKE256,
HashType::BLAKE512,
HashType::BLAKE3,
HashType::SHA1,
HashType::MD5,
];
// Also accepts a vec of HashType for runtime determination
let mut hashes = Hashes::new(&hash_types);
// Anything impl AsRef<[u8]>
hashes.digest("HashStream2025");
// Returns a Vec of HashReturn, which can each convert into
// an Arc<[u8]> with .into_bytes()
// or to lowercase hex with .as_hex()
// Optionally use hashstream::u8_array_to_upper_hex_string(&hashreturn.into_bytes())
// if uppercase hex is preferred
let ret = hashes.complete();
~~~
*sum utils on Arch for me, but slower under Alma and MacOS...