baseenc

package
v0.19.7 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package baseenc declares the error codes and the sentinels of the base-N codec family (base64, base64url, base32, base16, hex, ascii85, base45, base58, base62), internal/service/data/codec/baseenc — range 0.3.24.* (ADR 0006 service/data/codec/baseenc block).

The codes live in the core at the path that mirrors the package emitting them (ADR 0160 §2) and keep the values they were allocated with: the LL byte 3 records the layer that allocated the range, not the directory that declares it today (ADR 0160 §3). Nothing here encodes or decodes — the mechanism, and the constructors that attach a failure's detail, stay in the service package.

Package baseenc — the sentinel *errs.Error values, one per code. Each Reason derives from its var name or from its Code constant (ADR 0020); the Public and Private texts are the ones the service package always emitted, so moving the declaration changed no rendering.

Index

Constants

View Source
const CodeBaseEncDecodeFailed errs.Code = 0x00_03_18_03 // 0.3.24.3

CodeBaseEncDecodeFailed identifies a base-N decode failure (malformed input rejected by the stdlib encoding/{hex,base32,base64,ascii85} decoders).

View Source
const CodeBaseEncMarshalFailed errs.Code = 0x00_03_18_01 // 0.3.24.1

CodeBaseEncMarshalFailed identifies a JSON-encode failure that happens before the base-N step in the universal "flatten to JSON, then base-N" pipeline.

View Source
const CodeBaseEncSizeExceeded errs.Code = 0x00_03_18_04 // 0.3.24.4

CodeBaseEncSizeExceeded identifies an Unmarshal input whose length exceeds the 10 MiB hard cap (CWE-400 memory-exhaustion defence).

View Source
const CodeBaseEncUnmarshalFailed errs.Code = 0x00_03_18_02 // 0.3.24.2

CodeBaseEncUnmarshalFailed identifies a JSON-decode failure that happens after the base-N step in the universal "base-N decode, then JSON" pipeline.

Variables

View Source
var (
	// BaseEncMarshalFailed wraps a JSON-side failure before base-N encoding.
	BaseEncMarshalFailed = errs.Define(CodeBaseEncMarshalFailed, "BASE_ENC_MARSHAL_FAILED",
		"base-N encoding failed",
		"service/data/codec/baseenc: encoding/json.Marshal returned an error before the base-N step")

	// BaseEncUnmarshalFailed wraps a JSON-side failure after base-N decoding.
	BaseEncUnmarshalFailed = errs.Define(CodeBaseEncUnmarshalFailed, "BASE_ENC_UNMARSHAL_FAILED",
		"base-N decoding failed",
		"service/data/codec/baseenc: encoding/json.Unmarshal returned an error after the base-N step")

	// BaseEncDecodeFailed wraps a malformed base-N input rejected by the
	// stdlib decoder.
	BaseEncDecodeFailed = errs.Define(CodeBaseEncDecodeFailed, "BASE_ENC_DECODE_FAILED",
		"base-N decoding failed",
		"service/data/codec/baseenc: stdlib base-N decoder rejected the input bytes")

	// BaseEncSizeExceeded fires when an Unmarshal input exceeds the 10 MiB cap.
	BaseEncSizeExceeded = errs.Define(CodeBaseEncSizeExceeded, "BASE_ENC_SIZE_EXCEEDED",
		"base-N input exceeds size limit",
		"service/data/codec/baseenc: len(data) exceeds maxBaseEncBytes (CWE-400 defence)")
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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