This commit is contained in:
26
src/commonMain/kotlin/com/infendro/encoding/Hex.kt
Normal file
26
src/commonMain/kotlin/com/infendro/encoding/Hex.kt
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.infendro.encoding
|
||||
|
||||
object Hex : Encoding() {
|
||||
private val CHARACTERS = arrayOf<Byte>(
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
||||
0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
|
||||
)
|
||||
|
||||
override fun encode(
|
||||
bytes: ByteArray,
|
||||
): ByteArray {
|
||||
return encode(
|
||||
bytes,
|
||||
CHARACTERS,
|
||||
)
|
||||
}
|
||||
|
||||
override fun decode(
|
||||
bytes: ByteArray,
|
||||
): ByteArray {
|
||||
return decode(
|
||||
bytes,
|
||||
CHARACTERS,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user