Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Random Binary Generator (not pseudo)

Tags:

c++

c#

How do I generate random binary values lets say 10 digits 0010101001 and I want to call this C1 I then want to create another one called C2 same again random 10 digit binary number.

C# is my language of choice.

Is there a bitset class for c#

something simple would be nice, like

int C1

for ( int C1 = 0; <=10; C1++)
     output bitset<0>

return 0;

Need to store c1 and c2 tho.

like image 240
G Gr Avatar asked Feb 12 '26 06:02

G Gr


1 Answers

If you want true random numbers, you need hardware your computer probably doesn't have. However, it can be added simply and cheaply - see here,for example.

However, I think that a good pseudo-random generator, such as those that come with Boost - see Boost random number generator for an example, will be sufficient for your needs