Random number test and occurrence

zhaozj2021-02-08  237

The random number of tests and random numbers in the process of encrypting decryption play a considerable role. Therefore, the quality of the random number is concerned. How to efficiently produce high quality random numbers is an important topic. Taking the random number of ASCII code as an example, the random number is the most basic inspection: We know that the value of 256 ASCII code is 0 to 255. The average value should be 127.5 when a set of random numbers should be 127.5. The same random number of random numbers in the two groups is approximately 1/256 = 0.00390625. If you deviate from this 2, it is not a good random number. A random number of occurrences: The random number generated by the random number generator in useful C language is generally available. If you want to use high quality random numbers. Referring to the following methods: "Sequence number transformation method" first modes of the random number of ASCII code is still as an example, such as a random number of 2560 elements: 1 Mono a value from zero to 255 loop number The sequence number of the length of 2560 2 randomly extracts the value of the value exchange 3 to make 2 to detect their effects multiple times until satisfaction.

Based on one principle: If we randomly change a collection of numbers, it can only be more ordered. Just like the size of the size but the color is different, the color is different, and we will get better and better, and it is impossible to converge. Therefore, although "randomly extracting two serial numbers makes their numerical exchange" are done with pseudo random numbers. However, it is impossible to produce trends in dehydly development. In actual operation, you can add some operations such as "reverse", "reflect" to speed up the process.

转载请注明原文地址:https://www.9cbs.com/read-2384.html

New Post(0)