Languages
[Edit]
EN

C# / .NET - generate array of random bytes

4 points
Created by:
Kate_C
19790

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
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join