Liking cljdoc? Tell your friends :D

fractal.engine.payload

L0 · PURE payload primitives (zero engine deps). The Merkle substrate (02 §3, §9): a blob's id is sha256:<hex> over canonical-bytes, so equal values dedup to one content-addressed node across every store impl and across processes. Store-coupled IO (maybe-intern / read-payload / hydrate-message) lives in fractal.engine.payload-io — NOT here — so store can depend on this pure ns without a cycle.

L0 · PURE payload primitives (zero engine deps). The Merkle substrate (02 §3,
§9): a blob's id is `sha256:<hex>` over `canonical-bytes`, so equal values
dedup to one content-addressed node across every store impl and across
processes. Store-coupled IO (maybe-intern / read-payload / hydrate-message)
lives in `fractal.engine.payload-io` — NOT here — so `store` can depend on
this pure ns without a cycle.
raw docstring

canonical-bytesclj

(canonical-bytes v)

Deterministic UTF-8 bytes for v: canonical EDN — sorted map keys, no meta, *print-length*/*print-level* nil, no namespaced-map shorthand. The same logical value always hashes the same way (02 §3). ⚠ Volatile fields (timestamps, ids) are simply part of whatever value you pass — a blob is only ever the bare value, never an event, so equal values dedup.

Deterministic UTF-8 bytes for v: canonical EDN — sorted map keys, no meta,
`*print-length*`/`*print-level*` nil, no namespaced-map shorthand. The same
logical value always hashes the same way (02 §3). ⚠ Volatile fields
(timestamps, ids) are simply part of whatever value you pass — a *blob* is
only ever the bare value, never an event, so equal values dedup.
sourceraw docstring

content-idclj

(content-id v)

The content hash id of v: "sha256:<hex>" over canonical-bytes.

The content hash id of v: `"sha256:<hex>"` over `canonical-bytes`.
sourceraw docstring

make-refclj

(make-ref id kind size)

Build a tagged payload-ref from an already-computed content id / kind / size. The store uses this (it already holds the canonical bytes) to avoid a second hash pass.

Build a tagged payload-ref from an already-computed content id / kind / size.
The store uses this (it already holds the canonical bytes) to avoid a second
hash pass.
sourceraw docstring

payload-ref?clj

(payload-ref? x)

True iff x is a tagged payload-ref. The ONLY structural test the engine ever does on a ref — the loop never inspects :payload/id (02 §3, §8).

True iff x is a tagged payload-ref. The ONLY structural test the engine ever
does on a ref — the loop never inspects `:payload/id` (02 §3, §8).
sourceraw docstring

ref-forclj

(ref-for v kind)

PURE content-addressed ref constructor for a value (the L0-DoD ctor): same value ⇒ identical sha256: ref ⇒ dedup. Stores reuse canonical-bytes + make-ref directly; this is the standalone value→ref form.

PURE content-addressed ref constructor for a value (the L0-DoD ctor): same
value ⇒ identical `sha256:` ref ⇒ dedup. Stores reuse `canonical-bytes` +
`make-ref` directly; this is the standalone value→ref form.
sourceraw docstring

sha256-hexclj

(sha256-hex bs)

Lowercase hex SHA-256 of the given bytes.

Lowercase hex SHA-256 of the given bytes.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close