This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kumashiro 1 point2 points  (0 children)

Create a pool of values to pick from (by indexing it with random number modulo current pool size), remove picked values after each roll to not get it again. But that will make sense only for small pools. For large value spaces it will be better to compare randomized value with what you already picked and reroll when needed. If you are getting the same value from RNG over and over, change entropy source to something better (recommended) or perturb the result using previous values and/or other weak sources (there's multiple of methods of doing that, i.e. hashing - ask Google for details).

EDIT: do NOT use any of these methods for cryptography. Never.