package com.reactnativerfidble

fun ByteArray.toHexString() =
    joinToString("") { "%02X".format(it) }

fun ByteArray.normalizeEPCH301() = this
/*
fun ByteArray.normalizeEPCH301(): ByteArray {
    // Padding byte = FF
    val paddingByte = 255.toByte()

    // Skip: -> 11 00 FF FF FF EE 00
    //           1  2  3  4  5  6  7
    val startSkip = 4 // TODO: Why not 7?

    // E.g. E2 80 68 91 00 00 50 00 BD 65 44 AA
    //       1  2  3  4  5  6  7  8  9 10 11 12
    val expectedEPCSize = 12

    var result = byteArrayOf()

    for (i in startSkip until this.size) {
        val currentByte = this[i]

        if (currentByte != paddingByte) {
            result += currentByte

            if (result.size == expectedEPCSize) {
                break
            }
        }
    }

    return result
}
*/