kencode

BaseRadix

open class BaseRadix(alphabet: Alphabet, val blockSize: Int = 32) : ByteEncoding(source)

Base-N codec over any Alphabet, converting blockSize bytes at a time. With more than 256 characters, partial blocks get a sentinel byte that preserves their length and leading zeros.

Parameters

alphabet

Digit characters.

Inheritors

Constructors

BaseRadix

constructor(alphabet: Alphabet, blockSize: Int = 32)(source)

Parameters

alphabet

Digit characters.


constructor(chars: String, blockSize: Int = 32)(source)

Properties

blockSize

Functions

decode

open override fun decode(input: CharSequence): ByteArray(source)

Decodes input back into bytes.

encode

open override fun encode(input: ByteArray, offset: Int = 0, length: Int = input.size - offset): String(source)

Encodes length bytes of input starting at offset.