io.github.binaryfoo.decoders.CountryCodeDecoder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of emv-bertlv Show documentation
Show all versions of emv-bertlv Show documentation
Some decoders for the data used in EMV credit card transactions.
package io.github.binaryfoo.decoders
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.HashMap
import kotlin.properties.Delegates
import io.github.binaryfoo.res.ClasspathIO
public class CountryCodeDecoder : PrimitiveDecoder {
override fun decode(hexString: String): String {
return numericToAlpha[hexString.substring(1)] ?: "Unknown"
}
class object {
private val numericToAlpha: Map by Delegates.blockingLazy {
csvToMap("numeric-country-list.csv", 3)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy