parseSha256Sumsfunctionfunction parseSha256Sums(text: string): ReadonlyMap<string, Sha256>The lines of a sha256sum or SHASUMS256.txt file, as file name to checksum; lines that are not a checksum and a name are skipped.
SHA-256 through Web Crypto (crypto.subtle, in every runtime and browser), and a typed Sha256: 64 lower-case hexadecimal digits that the compiler keeps apart from any other string, so a checksum is never confused with a version or a path (commons 0001-crypto FR-001). Taken from the machine setup's result.ts and net.ts, and the many call sites that write the hex loop by hand.
import { sha256, sha256Of } from "./sha256.ts";
const sum = await sha256(new TextEncoder().encode("abc"));
sum === sha256Of("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); // trueparseSha256Sumsfunctionfunction parseSha256Sums(text: string): ReadonlyMap<string, Sha256>The lines of a sha256sum or SHASUMS256.txt file, as file name to checksum; lines that are not a checksum and a name are skipped.
sameSha256functionfunction sameSha256(a: Sha256, b: Sha256): booleanWhether two checksums are the same, compared in constant time for their length.
sha256functionfunction sha256(data: string | Uint8Array<ArrayBufferLike>): Promise<Sha256>The SHA-256 of bytes, or of text as UTF-8.
sha256Offunctionfunction sha256Of(text: string): Sha256 | undefinedThe text as a checksum where it is one (upper-case digits are lowered), else undefined.
Sha256typetype Sha256 = Brand<string, "Sha256">;64 lower-case hexadecimal digits: a SHA-256 checksum.