std.crypto
Types
interface Aead
struct AeadError
interface Algorithm
interface AssociatedOid
interface BlockCipher
enum BlockPadding
interface Hash
struct InvalidLengthError
struct ObjectIdentifier
struct PadError
struct ParseOidError
struct Pkcs1Error
struct Pkcs8Error
struct SpkiError
struct UnpadError
Functions
[src]
pub fn hash<T: Hash>(data: Bytes): Bytes {
let digest = T.new();
digest.update(data);
return digest.digest();
}
Hashes the given data using the given hash function.
[src]
pub fn hash<T: Hash>(data: Bytes): Bytes {
let digest = T.new();
digest.update(data);
return digest.digest();
}
Hashes the given data using the given hash function.
Hashes the given data using the given hash function.
Example
navi
use std.crypto.{hash, sha2.Sha256};
let data = "hello".bytes();
let hash = hash::<Sha256>(data);