Module cryptoxide::sha1
source · Expand description
An implementation of the SHA-1 cryptographic hash algorithm.
it is however discouraged to use this algorithm in any application as is, as this is not considered secured anymore. the algorithm is deprecated since 2011, and chosen prefix attack are practical.
However the hash function is still pervasively used in other contextes where security is still ok (e.g. hmac-sha1), so on this basis is available here.
Example
use cryptoxide::{sha1::Sha1, digest::Digest};
let mut digest = [0u8; 20];
let mut context = Sha1::new();
context.input(b"hello world");
context.result(&mut digest);
Structs
Structure representing the state of a Sha1 computation