Barograph.Labels (barograph v0.2.0)

Copy Markdown View Source

Label canonicalisation and series hashing (spec §5.1).

Keys are sorted, each entry rendered as key=value, and entries are joined with \x00 separators. The canonical string is hashed with BLAKE2b truncated to 16 bytes. Deterministic across nodes and restarts.

Summary

Functions

Renders a label map into its canonical string form.

Returns the 16-byte BLAKE2b hash of the canonicalised labels.

Functions

canonical(labels)

@spec canonical(map()) :: binary()

Renders a label map into its canonical string form.

hash(labels)

@spec hash(map()) :: <<_::128>>

Returns the 16-byte BLAKE2b hash of the canonicalised labels.