I want to generate eight bit (uint8_t) random numbers so that I exclude a set of well known numbers which have already been specified. Basically numbers from 0x00 – 0xFF but I have certain numbers within that range that I do not want to appear.
I am thinking of just populating a vector with the numbers allowed and pick a (pseudo) random index and use that one.
I suspect their may be serious short comings with this so looking for leads/advice. The solution need not be rocket science grade but just simple enough to “appear” random 🙂
EDIT: I do not want to use external libraries like boost as I am working on ARM embedded solution
EDIT: I do not have support for C++11
I think this will work a little bit faster than @IceCoder’s solution.