Cherry.StableJSON (cherry v0.1.0-rc.1)

Copy Markdown View Source

Byte-deterministic JSON for emitted output (ADR 0005): object keys are written in sorted order.

The VM iterates atom-keyed maps in atom-creation order, which varies between runs — JSON.encode!/1 alone cannot promise the same bytes for the same value. Every JSON document that lands in _site/ goes through here instead.

Summary

Functions

Encodes with every object's keys sorted — same value, same bytes.

Functions

encode!(value)

@spec encode!(term()) :: String.t()

Encodes with every object's keys sorted — same value, same bytes.