Without going much into details, I'll have a Pi working as a game server. Players make requests to that server. For each player, the Pi will have a table of pre-computed MD5 hashes corresponding to each correct request to be made, in a total of around 2000 hashes. Therefore the Pi, when serving a player's request, must have that hash table handy.
First, I thought of having the PI compute those 2000 MD5 hashes immediately when the player signs up and saving them on the SD card. Then, it would just load it back from the card whenever it needs those hashes.
However, I'm thinking that going around card I/O and file processing might be actually slower than computing all 2000 MD5 hashed on the fly everytime they're needed. My current SD card is class 4 and has an acceptable performance in the 4K random access benchmark.
My question is this: For those that have tested the CPU vs I/O performance, what should be faster? Caching on SD, or computing on the fly?
EDIT: The typical command will be:
hashes["key"] = hashlib.md5(b"constant_str" + variableStr).hexdigest()
multiplied by 2000. Total chars to be hashed will not exceed 50.
EDIT2 : To build some context, this is the game I'm creating: http://www.zorean.com/marklane - The player has to find evidence on the 'net in the form of files. The filenames are the "answers". The player will then log to a site (controlled by the Pi) to "give the answers" and be scored according to several factors.
EDIT3 : Hashing the player's answers is to avoid people hacking the web server and getting the answers that are temporarily stored there. These hashes are exchanged between the webserver and the Pi at the office and are invisible to the player. The Pi will regularly poll the webserver for the latest answers, download them, compute a score, and update the player's profile on the website. This makes it harder to brute-force 2000 MD5 hashes than actually play the game.