All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.binaryfoo.decoders.CountryCodeDecoder.kt Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package io.github.binaryfoo.decoders

import kotlin.text.substring

class CountryCodeDecoder : PrimitiveDecoder {

    override fun decode(hexString: String): String {
        return numericToAlpha[hexString.substring(1)] ?: "Unknown"
    }

    companion object {

        private val numericToAlpha: Map by lazy {
            csvToMap("numeric-country-list.csv", 3)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy