#byte-slice #allowing #abstracting #digests #hash-functions #blake2b #wrapped

bytehash

Trait abstracting over hash-functions, allowing digests to be viewed as byte slices

4 releases (2 breaking)

Uses old Rust 2015

3.0.0 Sep 5, 2018
2.0.0 Aug 19, 2018
1.0.0 Aug 12, 2018
0.3.0 Apr 10, 2020
0.1.0 Nov 7, 2019

#958 in Cryptography


Used in 5 crates (via kelvin)

MIT/Apache

6KB
131 lines

ByteHash

Trait abstracting over hash-functions, allowing digests to be viewed as byte slices.

This allows you to use cryptographic and non-cryptographic hash functions interchangeably.

Documentation

Example

use bytehash::{Blake2b, ByteHash, Wrapped};
use std::collections::hash_map::DefaultHasher;

fn main() {
    let mut blake = Blake2b::default();
    blake.write(b"hello world").unwrap();
    let hash = blake.fin();

    let mut default = Wrapped::<DefaultHasher>::default();
    default.write(b"hello world").unwrap();
    let hash = default.fin();
}

lib.rs:

Trait abstracting over hash-functions, allowing digests to be viewed as byte slices.

Dependencies

~260KB