interactioncode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package interactioncode generates and canonicalizes AAuth interaction codes (draft-hardt-oauth-aauth-protocol-09; format per the interaction-code requirements: unambiguous alphabet, minimum entropy). Mirrors @aauth/interaction-code from the reference TypeScript packages.

Codes are 8 characters of Crockford base32 (40 bits of entropy) rendered as XXXX-XXXX. The Crockford alphabet excludes I, L, O, U; canonicalization folds the lookalikes a user might type (i/l→1, o→0) and uppercases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(code string) (string, error)

Canonicalize normalizes user input for comparison: uppercase, strip separators/whitespace, fold I/L→1 and O→0, re-hyphenate as XXXX-XXXX.

func Generate

func Generate() (string, error)

Generate returns a fresh interaction code in XXXX-XXXX form (40 bits).

Types

This section is empty.

Jump to

Keyboard shortcuts

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