docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

core::crypto::sha2

On this page

SHA-2 (FIPS 180-4): SHA-256, SHA-384 and SHA-512. Digest is a running hash of any HashAlgorithm, SHA-2 or SHA-3 (sha3).

Structs

DigestSource

pub struct Digest

A running hash of a HashAlgorithm. A value: copying it forks the running hash (a transcript hash read mid-way).

  • pub const fn new(alg: HashAlgorithm) -> Digest§

    Source

    An empty running hash of alg.

  • pub const fn algorithm(self) -> HashAlgorithm§

    Source

    The algorithm it runs.

  • pub fn update<B: AsBytes>(ref self, data: B)§

    Source

    Feed data into the hash; call finish for the digest.

  • pub const fn finish(self) -> List<u8>§

    Source

    The digest of everything fed so far, alg.output_len() bytes.

Trait implementations 1