What is the best way to generate a number with 256 random bits?
Does random byte concatenation work?
byte[] data = new byte[32];
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetNonZeroBytes(data);
string number = BitConverter.ToString(data, 0).Replace("-", "");
Also, would it be appropriate to sort the deck of cards using non-duplicates of these numbers?
source
share