IF Commons GitHub

logical/sha256

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0012-executor-check-mode FR-004

SHA-256 of text, in pure TypeScript (FIPS 180-4), so that the hash of a plan is the same on every runtime and the logical layer needs no host module for it. It is for naming a plan (planHash): a digest that a signer can sign and a verifier recompute; it keeps no key and signs nothing.

import { sha256Hex } from "./sha256.ts";
sha256Hex("abc"); // "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"

Source: commons/headless/src/logical/sha256.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.sha256functionno test imports it
function sha256(bytes: Uint8Array<ArrayBufferLike>): Uint8Array<ArrayBufferLike>

The SHA-256 digest of bytes.

logical.sha256Hexfunctionno test imports it
function sha256Hex(text: string): string

The SHA-256 digest of text (as UTF-8), in lower-case hexadecimal.

sha256functionno test imports it
function sha256(bytes: Uint8Array<ArrayBufferLike>): Uint8Array<ArrayBufferLike>

The SHA-256 digest of bytes.

sha256Hexfunction
function sha256Hex(text: string): string

The SHA-256 digest of text (as UTF-8), in lower-case hexadecimal.

Imported by 5 tests of the run (5 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.