~/bend-docscommunity

src/base64.bend checks

raw source on the hub · import bend-kube-runtime@0.5.5.0/src/base64.bend as Base64

1 import
import Base

Types

type B64 source · line 10 · raw

Data

Definitions

def B64.val.go source · line 13 · raw

@+x:U32 -> @up:Bool -> @low:Bool -> @dig:Bool -> U32

def B64.val source · line 25 · raw

@+c:Char -> U32

The 6-bit value of a char: 64 for skipped chars, 65 for bad ones.

def B64.next.go source · line 44 · raw

@+acc:U32 -> @+bits:U32 -> @ok:Bool -> @+v:U32 -> @skip:Bool -> @bad:Bool -> @full:Bool -> B64

def B64.next source · line 59 · raw

@st:B64 -> @+v:U32 -> B64

The state after a char's value v.

def B64.emit.go source · line 64 · raw

@+acc:U32 -> @+bits:U32 -> @+v:U32 -> @out:List<&2, U32> -> @skip:Bool -> @full:Bool -> List<&2, U32>

def B64.emit source · line 73 · raw

@st:B64 -> @+v:U32 -> @out:List<&2, U32> -> List<&2, U32>

The byte a char completes, pushed onto out (reversed).

def B64.go source · line 78 · raw

@s:String -> @+st:B64 -> @out:List<&2, U32> -> Pair(B64, List<&2, U32>)

def B64.decode.fin source · line 85 · raw

@r:Pair(B64, List<&2, U32>) -> Maybe<&2, List<&2, U32>>

def B64.decode source · line 93 · raw

@s:String -> Maybe<&2, List<&2, U32>>

The bytes a base64 text spells; None if a char is outside the alphabet.

def B64.chr.go source · line 96 · raw

@+v:U32 -> @up:Bool -> @low:Bool -> @dig:Bool -> @plus:Bool -> Char

def B64.chr source · line 109 · raw

@+v:U32 -> Char

def B64.encode source · line 113 · raw

@bs:List<&2, U32> -> String

Encodes bytes, three at a time, with '=' padding.