[][src]Crate inc_sha1

Incremental SHA1 Calculator

Inc-SHA1 is a library for incrementally calculating an SHA-1 hash value. It uses the sha crate but encapsulates handling of partial blocks and final padding so that the application can simply write any number of blocks of bytes of any length and ask for a final hash value.

Example

let mut hasher = inc_sha1::Hasher::new();
hasher.write(b"Hello ");
hasher.write(b"World!");
let hash = hasher.finish();
let hex_hash = hex::encode(hash);
assert_eq!(hex_hash, "2ef7bde608ce5404e97d5f042f95f89f1c232871");

Structs

Hasher

An in-progress SHA-1 hash operation.

Constants

LENGTH_BITS

The length of an SHA-1 hash value, in bits.

LENGTH_BYTES

The length of an SHA-1 hash value, in bytes.

Type Definitions

Hash

An SHA-1 hash value.