Skip to content

std/build/reckon/hash

std/build/reckon/hash

Type Aliases

DigestibleSchemaStep

type DigestibleSchemaStep = Readonly<{
  id: string;
  sql: string;
}>;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:7

The only fields whose exact ordered bytes participate in a schema migration digest.

Variables

canonicalSchemaStepEncoding

const canonicalSchemaStepEncoding: (steps) => string;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:18

Browser-safe byte-for-byte input for a schema migration digest.

This is UTF-8 JSON.stringify of an array of { id, sql } objects, with those keys in that order, steps in application order, and no whitespace or newline. Re-projecting the keys prevents caller metadata or object construction order from changing the digest. SQL remains exact.

Parameters

Parameter Type
steps ReadonlyArray<DigestibleSchemaStep>

Returns

string


digestSchemaSteps

const digestSchemaSteps: (steps) => string;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:20

SHA-256 of canonicalSchemaStepEncoding, labelled so algorithms cannot be confused.

Parameters

Parameter Type
steps ReadonlyArray<DigestibleSchemaStep>

Returns

string

Functions

hashDefinition()

function hashDefinition(def): string;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:2

Parameters

Parameter Type Description
def { components?: { [key: string]: object; }; dependsOn?: readonly string[]; exprs: { [key: string]: string; }; id: string; outputs: readonly string[]; tables: { [key: string]: | { kind: "flat"; rows: readonly object[]; } | { kind: "tier"; rows: readonly object[]; } | { kind: "progressive"; rows: readonly object[]; } | { dimensions: readonly object[]; kind: "matrix"; rows: readonly object[]; }; }; } -
def.components? { [key: string]: object; } Optional mapping from output expr ids to payslip component metadata.
def.dependsOn? readonly string[] Other computation definition ids whose outputs feed into this one's inputs.
def.exprs { [key: string]: string; } Named CEL expressions. Each expr can reference inputs, other exprs, and registered ops.
def.id string Unique identifier for this definition.
def.outputs readonly string[] Which expr names are exposed as outputs.
def.tables { [key: string]: | { kind: "flat"; rows: readonly object[]; } | { kind: "tier"; rows: readonly object[]; } | { kind: "progressive"; rows: readonly object[]; } | { dimensions: readonly object[]; kind: "matrix"; rows: readonly object[]; }; } Inlined rate/classification tables, keyed by name. Referenced in exprs via string literals.

Returns

string


sha256Json()

function sha256Json(value): string;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:3

Parameters

Parameter Type
value unknown

Returns

string


sha256Text()

function sha256Text(message): string;

Defined in: apps/website/.api-docs-entry/std/build/reckon/hash.d.ts:5

Hashes exact UTF-8 text without requiring a Node.js crypto runtime.

Parameters

Parameter Type
message string

Returns

string