docs

你正在阅读 v0.1.2 的文档。Nabi 0.1.2 已不再提供支持。 最新版本:v0.1.3 →

core::crypto::sha2

本页内容

API 参考只有英文版,由标准库源代码中的英文文档注释生成。

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