use portable random number generator