encoding

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package encoding provides stable JSON encoding, hashing, and checksums.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalJSON

func CanonicalJSON(raw []byte) ([]byte, error)

CanonicalJSON returns the RFC 8785 canonical form of one JSON value.

func Checksum

func Checksum(value any, algorithm string) (string, error)

Checksum computes the requested compatibility checksum.

func Hash

func Hash(value any, algorithm string) (string, error)

Hash hashes strings as exact UTF-8 and other values as canonical JSON.

func HexDecode

func HexDecode(value string) (string, error)

HexDecode decodes hexadecimal text and requires valid UTF-8 output.

func HexEncode

func HexEncode(value string) string

HexEncode returns lowercase hexadecimal for the UTF-8 bytes of value.

func Options

func Options() []exprlib.Option

Options returns the Expr registrations for encoding helpers.

func URLDecode

func URLDecode(value, mode string) (string, error)

URLDecode unescapes value using the explicit query or path_segment mode.

func URLEncode

func URLEncode(value, mode string) (string, error)

URLEncode escapes value using the explicit query or path_segment mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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