pos

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 3 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pos implements deixis-pos-v1 — the spelling of positions into deixis keys.

κ(i) = ff^(len(mag(i)) − 1) ‖ 00 ‖ mag(i)

where mag(i) is the shortest unsigned big-endian encoding of i, with mag(0) = 00. See docs/design/0002-positional-keys.md. The spelling is injective, prefix-free, and order-preserving: i < j iff κ(i) sorts before κ(j) in unsigned lexicographic byte order — so a positionally-keyed struct's canonical entry order is sequence order, and a consumer walking a sequence never parses a key.

The profile is total over ℕ; this implementation spells the uint64 range, which bounds nothing about the profile (a wider integer spells wider positions with the same rule).

There is deliberately no decoder: consumers recognize positional structure by generating Key(0) ‖ Key(1) ‖ … and comparing octets, or test membership with IsKey. Normalizing a non-canonical spelling to its index would be a repair pass, and a repair pass coarsens identity.

Index

Constants

View Source
const Profile = "deixis-pos-v1"

Profile is the name of the profile this package implements.

Variables

This section is empty.

Functions

func IsKey

func IsKey(b []byte) bool

IsKey reports whether b is κ(i) for some i — exact membership, no normalization.

Rejects truncation, a malformed run/terminator, a non-shortest magnitude, and trailing bytes. IsKey(Key(i)) holds for every i.

func Key

func Key(i uint64) []byte

Key is κ(i) — the key bytes spelling position i.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL