DefaultHex

Hex

Provides cross-platform utilities for encoding values into hex, or decoding values from hex. Available on any target platform supported by Elide/Kotlin, including native platforms.

Properties

Link copied to clipboard

Array of hex-allowable characters.

Functions

Link copied to clipboard
open fun decode(data: HexData): ByteArray

Decode the provided raw data from the encoding implemented by this encoder; return a raw ByteArray of the resulting data.

Link copied to clipboard
open override fun decodeBytes(data: ByteArray): ByteArray

Decode the provided data from the encoding implemented by this encoder; return a raw ByteArray of the resulting bytes.

Link copied to clipboard
open fun decoder(): Decoder<HexData>

Provide an Encoder specialized to the format implemented by this Codec; the resulting object can only guarantee a capability to encode data to the target encoding.

Link copied to clipboard
open fun decodeString(string: String): ByteArray

Decode the provided string using the encoding implemented by this encoder; return a raw ByteArray of the resulting bytes.

Link copied to clipboard

Decode the provided data from the encoding implemented by this encoder; return a String representation of the resulting data.

open fun decodeToString(string: String): String

Decode the provided string from the encoding implemented by this encoder; return a String representation of the resulting data.

Link copied to clipboard
open override fun encode(data: ByteArray): HexData

Encoded the provided data using the encoding implemented by this encoder; the returned Raw instance is able to provide a resulting ByteArray or String.

Link copied to clipboard

Encode the provided data using the encoding implemented by this encoder; return a ByteArray representation of the result.

Link copied to clipboard
open fun encoder(): Encoder<HexData>

Provide a Decoder specialized to the format implemented by this Codec; the resulting object can only guarantee a capability to decode data from the subject encoding.

Link copied to clipboard
open fun encodeString(string: String): ByteArray

Encode the provided string data using the encoding implemented by this encoder; by default, the string will be interpreted using UTF-8 encoding, then encoded to the target encoding.

Link copied to clipboard

Encode the provided data to a string representation using the encoding implemented by this encoder.

open fun encodeToString(string: String): String

Encode the provided string to a string representation using the encoding implemented by this encoder; the string is interpreted using UTF-8 encoding.

Link copied to clipboard
open override fun encoding(): Encoding

Return the enumerated Encoding which is implemented by this Codec.