Crate sha1_asm [] [src]

An implementation of the SHA-1 cryptographic hash algorithm.

Example

use sha1_asm::{Sha1, Digest};

// create a Sha1 object
let mut sh = Sha1::default();
 
// write input message
sh.input(b"hello world");

// read hash digest in the form of GenericArray which is in this case
// equivalent to [u8; 20]
let output = sh.result();
assert_eq!(output[..], [0x2a, 0xae, 0x6c, 0x35, 0xc9, 0x4f, 0xcf, 0xb4, 0x15, 0xdb,
                        0xe9, 0x5f, 0x40, 0x8b, 0x9c, 0xe9, 0x1e, 0xe8, 0x46, 0xed]);

Structs

Sha1

Structure representing the state of a Sha1 computation

Constants

H

Traits

Digest

The Digest trait specifies an interface common to digest functions. It's a convinience wrapper around Input and FixedResult traits