The principle and implementation of random numbers