Default
Base32 encoding/decoding in accordance with RFC 4648 section 6
e.g.
val default = Base32.Default.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(default)
println(encoded) // JBSWY3DPEBLW64TMMQQQ====
// Alternatively, use the static implementation containing
// pre-configured settings, instead of creating your own.
val decoded = encoded.decodeToByteArray(Base32.Default).decodeToString()
assertEquals(text, decoded)Content copied to clipboard
See also
Types
Link copied to clipboard
A static instance of EncoderDecoder configured with a Default.Builder.lineBreak interval of 64, and remaining Default.Builder DEFAULT values.
Link copied to clipboard
Holder of a configuration for the Default encoder/decoder instance.