std/digest
Message digests: Sha256 and Sha512, the SHA-256 and SHA-512 of FIPS 180-4, and the Digest both answer.
SHA-256 is what the package manager pins a package by (docs/design/RELEASE.md section 7.2) and what a download is
checked against; SHA-512 is what Ed25519 hashes with (std/signature).
Ordinary TorbScript with no native. SHA-256 works over Int, every word kept below 2^32 by a mask, so nothing
overflows; SHA-512 over UInt64 and its wrapping sum. The same bytes give the same digest in both back ends.
Modules
std/digest/libMessage digests: [Sha256] and [Sha512], the SHA-256 and SHA-512 of FIPS 180-4, and the [Digest] both answer.std/digest/sha512[Sha512], the SHA-512 of FIPS 180-4: the hash Ed25519 is defined over (RFC 8032 section 5.1,std/signature), and the same shape asSha256- fed at once or in pieces, answering a [Digest] of 64 bytes.
Everything
- type
DigestWhat a hash function answers: its bytes, most significant first, shown as lowercase hexadecimal. - type
Sha256SHA-256, fed in pieces: [Sha256.add] takes the next bytes and [Sha256.finished] answers the digest of everything added so far without changing the hasher, so a hasher can be read, fed more, and read again. - type
Sha512SHA-512, fed in pieces: [Sha512.add] takes the next bytes and [Sha512.finished] answers the digest of everything added so far without changing the hasher, so a hasher can be read, fed more, and read again.