random number generation in device