ByteArrayAsHexSerializer

object ByteArrayAsHexSerializer : KSerializer<ByteArray>

Serializes ByteArray as a lowercase hex string.

Example: 0xe5, 0x6e, 0xc1 -> "e56ec1"

Usage:

@Serializable
data class MyData(
@Serializable(with = ByteArrayAsHexSerializer::class)
val bytes: ByteArray
)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): ByteArray
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: ByteArray)