[][src]Function extendhash::sha0::compute_hash

pub fn compute_hash(input: &[u8]) -> [u8; 20]

Compute the SHA-0 hash of the input data

Arguments

  • input - The input data to be hashed - this could be a UTF-8 string or any other binary data.

Returns

This function returns the computed SHA-0 hash.

Example

let secret_data = "abc".as_bytes();
let hash = sha0::compute_hash(secret_data);
assert_eq!(hash, [
    0x01, 0x64, 0xb8, 0xa9, 0x14, 0xcd, 0x2a, 0x5e, 0x74, 0xc4,
    0xf7, 0xff, 0x08, 0x2c, 0x4d, 0x97, 0xf1, 0xed, 0xf8, 0x80]);