Package countrycode
provides utilities for representing countries in code, and handling their serializations and deserializations in a convenient way.
All deserializations will result in CountryUndefined
if input data is not a recognized country code.
All the exported types are one word in memory and as such provide fast equality checks, hashing for usage as keys in maps. Conversions between the types are zero overhead (don't even escape the stack), serialization is worst case O(1)
, and deserialization is worst case O(n)
.
MIT License. See LICENSE for more details.