Hex

Base32 encoding/decoding in accordance with RFC 4648 section 7

e.g.

val hex = Base32.Hex.Builder {
    isLenient(enable = true)
    lineBreak(interval = 64)
    lineBreakReset(onFlush = true)
    encodeLowercase(enable = false)
    padEncoded(enable = true)
    backFillBuffers(enable = true)
}

val text = "Hello World!"
val bytes = text.encodeToByteArray()
val encoded = bytes.encodeToString(hex)
println(encoded) // 91IMOR3F41BMUSJCCGGG====

// Alternatively, use the static implementation containing
// pre-configured settings, instead of creating your own.
val decoded = encoded.decodeToByteArray(Base32.Hex).decodeToString()
assertEquals(text, decoded)

See also

Types

Link copied to clipboard
class Builder

A Builder

Link copied to clipboard

A static instance of EncoderDecoder configured with a Hex.Builder.lineBreak interval of 64, and remaining Hex.Builder DEFAULT values.

Link copied to clipboard

Holder of a configuration for the Hex encoder/decoder instance.

Functions

Link copied to clipboard
protected override fun name(): String
Link copied to clipboard
Link copied to clipboard