Languages
[Edit]
EN

C# / .NET - generate array of random bytes

4 points
Created by:
Pearl-Hurley
559

Random.NextBytes method example

Random random = new Random();

byte[] bytes = new byte[10];
random.NextBytes(bytes);
			
foreach(byte entry in bytes)
	Console.WriteLine(entry);

Output:

100
206
3
229
45
247
73
187
44
237

References

  1. Random Class - Microsoft Docs
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

C# / .NET - random

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join