1. A computer-implemented method of generating a pseudo random number satisfying a range constraint and a mask constraint, the method performed by a computer having a processor and a memory unit, the method comprising: determining a number of possible solutions satisfying said range constraint and said mask constraint; selecting an index representing a solution of said possible solutions; and generating said pseudo random number based on said index.