Random number generator module in Python (true/pseudo random number)

True random number generator (TRNG) The true random number generator generates random numbers that are almost unpredictable, because the factors that affect the change of the result value are the characteristics of the physical environment. For example, rolling a dice will generate random values ​​that are difficult to predict. But the number of dice is limited to 1 to 6. Therefore, it is almost difficult to predict the generation of random numbers, and random numbers are part of the mechanical properties.

Pseudo Random Number Generator (PRNG) PRNG is not a true random number generator because the algorithm generates a series of random numbers. The resulting random value is generated from the initial value (called the seed value).

In Python, random values ​​are generated by using the random module, and the generator itself is a pseudo-random number generator (PRNG). This module uses the Mersenne Twister algorithm as its core generator, which is reliable and has passed many statistical randomness tests. Similarly, NumPy provides the function of using random numbers, which can also generate a sequence of numbers, such as arrays of different dimensions. The secret module in python generates random numbers with high encryption strength. Python's uuid (Universal Unique Identifier) ​​module creates a 128-bit ordered random value.

I still want to recommend the Python learning group I built by myself : 721195303. All students in the group are learning Python. If you want to learn or are learning Python, you are welcome to join. Everyone is a software development party and shares dry goods from time to time (only Python software development related), including a copy of the latest Python advanced materials and zero-based teaching compiled by myself in 2021. Welcome friends who are in advanced and interested in Python to join!
**The following content is useless, this blog was crawled and used by search engines
(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶  ̄)(* ̄︶ ̄)(* ̄︶ ̄) What
is python? How long does it take to learn python? Why is it called crawler
python? Crawler rookie tutorial python crawler universal code python crawler how to make money
python basic tutorial web crawler python python crawler classic examples
python reptiles
(¯)¯ *) (* ¯)¯) (¯)¯ *) (* ¯)¯) (¯)¯ *) (* ¯)¯) ( ¯)¯) ( ¯)¯)
above The content is useless, this blog was crawled and used by search engines

Guess you like

Origin blog.csdn.net/aaahtml/article/details/114276778