Skip to main content

Module value

Module value 

Source
Expand description

Persisted rows as the web page stores them: JavaScript values with ordered object fields, typed arrays and blobs.

The page writes plain JS objects into IndexedDB, and both its export package and the scenario fingerprint (scripts/fingerprint-scenarios.ts) read them back field by field, in insertion order. The native host keeps the same values, built field by field in the same order, so a native run’s rows can be compared with the page’s row for row (fingerprint).

Structs§

Obj
An object: fields in insertion order. Setting an existing field keeps its position, as in JavaScript.

Enums§

Js
A JavaScript value as a row holds it.
Typed
The typed-array constructor a byte buffer stands for (its elements are little-endian).

Functions§

canonical
The value scripts/fingerprint-scenarios.ts’s canon() makes of a row: wall-clock and id fields dropped, the run id replaced by <run>, typed arrays and blobs replaced by their digests, COMPUTE_BACKEND’s host-timed message and detail dropped.
detail
A diagnostic detail payload as a value.
fingerprint
A row’s fingerprint digest: the short SHA-256 of JSON.stringify(canon(row)).
read_rect
Reads { x, y, width, height }.
rect
{ x, y, width, height }.
short_sha
The first 12 bytes of SHA-256, in hex: the fingerprint’s digest.
to_fixed
Number.prototype.toFixed(digits): the exact value rounded half away from zero (JS picks the larger n on a tie of the exact binary value), in plain notation below 1e21.
to_json
to_locale
Number.prototype.toLocaleString() in the en-US locale Deno and the page default to: grouped thousands, at most three fraction digits.
write_json
JSON.stringify of a value (typed arrays and blobs must have been replaced first; see canonical).