even very good pseudo-random generators are likely to design patterns with millions of digits, right?
From Wikipedia on the generation of pseudorandom numbers :
PRNG can be started from an arbitrary initial state using the initial state. It will always produce the same sequence after initialization with this state. The maximum length of a sequence before it begins to repeat is determined by the size of the state, measured in bits. However, since the length of the maximum period potentially doubles when each bit of the “state” is added, it is easy to create PRNGs with periods sufficient for many practical applications.
Perhaps you could create large random numbers by putting random numbers on random metrics
I assume that you suggest something like filling in the values of scientific notation with random values?
For example: 1.58901231 x 10^5819203489
The problem is that your distribution will be logarithmic (or is it exponential? :) - the same difference, it's not even that). You will never get a value that has a millionth set of digits but contains a digit in one column.
you could try to generate a possibly uneven distribution on the smallest possible range (for example, using real numbers) and convert
Not sure if I understand that. It looks like the same as an exponential solution, with the same problems. If you are talking about multiplying by a constant, you get a lumpy distribution instead of a logarithmic (exponential?).
Recommended Solution
If you just need really big pseudorandom values with a good distribution, use a large state PRNG algorithm. The frequency of a PRNG is often the square of the number of bits, so it doesn’t need to fill even a very large number, so to fill even a very large number.
From there you can use your first solution:
You can randomly generate each digit and concatenate
Although I would suggest using the entire range of values returned by your PRNG (maybe 2 ^ 31 or 2 ^ 32), and populate the byte array with these values, dividing it as necessary. Otherwise, you can drop many bits of randomness. Also, scaling your values to a range (or using modulo) can easily ruin your distribution, so there is another reason to try and keep the maximum number of bits your PRNG can return. However, be careful to pack an array of bytes full of bits returned, or you will again take a chunk to your distribution.
However, the problem with this solution is how to fill this (larger than usual) seed state with values that are reasonably significant. You might be able to use standard-sized seeds (populated over time or GUID type populations) and populate your state with a large PRNG with values from a smaller PRNG. This can work if it is not critical how well your numbers are distributed.
If you need truly cryptographically secure random values, the only real way to do this is to use a natural form of randomness, for example, at http://www.random.org/ . The disadvantages of natural randomness are accessibility and the fact that many natural random devices take some time to generate new entropy, so generating large amounts of data can be very slow.
You can also use the hybrid and be safe - only natural random seeds (to avoid slow generation) and PRNG for the rest. Reclaim periodically.