readme updates

This commit is contained in:
2025-08-19 20:43:13 -04:00
parent 64af27a729
commit c004fe93a3

View File

@@ -8,6 +8,8 @@ Hashstream does not perform any file IO on its own, it only reads and writes to
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`
# Usage
` dd if=/dev/zero bs=4M count=250 status=progress | hashstream --sha256 `
@@ -34,6 +36,44 @@ Options:
```
Or, as a library within your own code (see main.rs)
```rust
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();
~~~
```
# TODO:
- Multithreading? Maybe higher performance for multiple hashes at same time?
@@ -41,3 +81,5 @@ Options:
- Passthrough processing? Maybe output hashes to stderr or socket / named pipe?
- More perf tuning? Is faster than `*sum` utils on Arch for me, but slower under Alma and MacOS...
- Polynym binary? i.e. like busybox, selects set of hashes based on binary / link name?
- Other output encoding options? Uppercase hex, base64, etc?
- Binary release?