I have 30,000 rows of key,value pairs consisting of a date and a 5 character token. Each date and token are unique, meaning there are no duplicate dates or tokens in the entire data set. Here is a sample:
The routine I want to write:
bool validateToken(const char* tkn) determines if the token provided matches the token associated with TODAYS date.
I believe the best container has the type
std::map<time_t, char> and was going to write a data structure in that format with all that data.
I was just given the data, but generally I think the tokens are all hex values and range between: 0x00000 - 0xFFFFF
I’m looking for a fast solution that uses a small memory space. What is the best approach to this?
Do I use PROGMEM to store this data in flash?
What if I wrote 30,000 rows of #define TOKEN_1465C <relevantunix_time_stamp> then did comparisons with todays date?
There is no hash function and a lookup table is the only way I have to do it.