kencode

BaseRadix

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

Generic base-N encoder/decoder for binary data using arbitrary alphabets and block processing.

Parameters

alphabet

The alphabet used to map digit values to characters.

Inheritors

Constructors

Link copied to clipboard
constructor(alphabet: Alphabet, blockSize: Int = 32)
constructor(chars: String, blockSize: Int = 32)

Properties

Link copied to clipboard

Number of input bytes processed per block; larger blocks pack more tightly but cost more BigInteger arithmetic.

Functions

Link copied to clipboard
open override fun decode(input: CharSequence): ByteArray

Decode an encoded string back into the original bytes.

Link copied to clipboard
open override fun encode(input: ByteArray, offset: Int = 0, length: Int = input.size - offset): String

Encode the given byte range into a text representation.

BaseRadix

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

Parameters

alphabet

The alphabet used to map digit values to characters.


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

blockSize

decode

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

Decode an encoded string back into the original bytes.

encode

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

Encode the given byte range into a text representation.