fun <T> BinaryFormat.encodeToHexString(serializer: SerializationStrategy<T>, value: T): String
inline fun <T> BinaryFormat.encodeToHexString(value: T): String

Serializes and encodes the given value to byte array, delegating it to the BinaryFormat, and then encodes resulting bytes to hex string.

Hex representation does not interfere with serialization and encoding process of the format and only applies transformation to the resulting array. It is recommended to use for debugging and testing purposes.


in case of any encoding-specific error

if the encoded input does not comply format's specification