wirevalue

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package wirevalue implements the M1 safe-integer JSON and canonicalization rules.

Index

Constants

View Source
const MaxInteger int64 = 9007199254740991

Variables

This section is empty.

Functions

func Canonical

func Canonical(value any) ([]byte, error)

Canonical serializes the protocol's safe-integer subset of RFC 8785 JCS. Values may use JSON-native maps/slices or typed Go JSON representations. Untrusted wire bytes must enter through Parse before reaching this API.

func Parse

func Parse(raw []byte) (any, error)

Parse preserves JSON values without floating-point rounding. Every number is returned as a normalized integer json.Number. Duplicate keys, invalid Unicode, fractions, unsafe integers, and trailing values are rejected.

func RequestHash

func RequestHash(method string, params map[string]any) (string, error)

RequestHash excludes only the idempotency key, not any semantic parameter.

func Validate

func Validate(definition string, value any) error

Validate validates a JSON-native value against one named frozen $defs entry. It enforces profile-wide Unicode and safe-integer rules before JSON Schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

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