refactor encodings

This commit is contained in:
2025-11-10 18:59:53 +01:00
parent 08a79efa04
commit 71a47af43c
5 changed files with 55 additions and 55 deletions

View File

@@ -1,14 +1,14 @@
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,
private val CHARACTERS = ubyteArrayOf(
0x30U, 0x31U, 0x32U, 0x33U, 0x34U, 0x35U, 0x36U, 0x37U,
0x38U, 0x39U, 0x61U, 0x62U, 0x63U, 0x64U, 0x65U, 0x66U,
)
override fun encode(
bytes: ByteArray,
): ByteArray {
bytes: UByteArray,
): UByteArray {
return encode(
bytes,
CHARACTERS,
@@ -16,8 +16,8 @@ object Hex : Encoding() {
}
override fun decode(
bytes: ByteArray,
): ByteArray {
bytes: UByteArray,
): UByteArray {
return decode(
bytes,
CHARACTERS,