flix

0.75.3

Orbit64.Internal.Encoding

Shared base64url arithmetic for every Orbit64 token class.

This module knows about characters and integers, not cubes. Keeping it below Internal prevents transport details from becoming a second public codec API beside Orbit64.State, Orbit64.Move, and Orbit64.Token.

Definitions

def alphabet(): String§ Source

The base64url alphabet, in index order.

Index 0 is A, so a zero written at fixed width is a run of As.

def decodeDelimitedRank(expectedClass: Int32, token: String): Result[String, (Int32, BigInt)]§ Source

Unpack and canonically validate a delimiter-padded rank token.

def digitOf(c: Char): Option[Int32]§ Source

Return the sextet represented by c.

def encodeDelimitedRank(tokenClass: Int32, layers: Int32, rank: BigInt): Result[String, String]§ Source

Pack a class, gamma-coded layer count, rank, marker, and zero fill.

def fromBase64(s: String): Option[BigInt]§ Source

Read a base64url string as an integer. Returns None for a foreign character.

def toBase64(acc: BigInt, w: Int32): String§ Source

Write acc as exactly w base64url characters, most significant first.