currencygithub.com/castedo/isomon

Name

isomon::data::code2hash — Low-level C function to hash ISO currency code.

Synopsis

// In header: </home/castedo/src/isomon/currency_data.h>


bool code2hash(const char * code, int16_t * out);

Description

Perfect hash, using smallest number of bits possible (15 bits) for ISO 4127 alphabetic codes which are 3 latin letters.

Parameters:

code

Pointer to a null-teminated string with ISO code.

out

NON-NULL pointer to integer to hold hash.

Returns:

True iff code is a 3 Latin alphabet letter string and hash written to out.