Problem reading random noise generator

wanderson:
Another approach, if your really only interested in values of 0-20 is to not create random bytes, but to create random nibbles (4-bits). Since the generator is producing uniform distributions you can generate random 4-bit values (0-31) with just as much validity as the 8-bit values you are currently, and then simply discard any random that is greater than 19. You just throwing away a little less then a bit that way. And since the calculations would be more efficient, it should actually be faster (even with the waste of random numbers) than the more general approach I suggested earlier.

This is a great idea. In the final application, the mapping range will be variable, but its maximum will be 20. I'll run some tests when I get off work, and if it works, perhaps I could just use the same technique to just adjust the maximum value of the random number produced - i.e., for a maximum mapping of 4, only produce a 2-bit number, or for maximum of 8, 3 bit (values would need to be 1-8 so I'd produce the 3-bit number and then add 1).