Languages
[Edit]
EN

C#/.NET - random bytes

2 points
Created by:
JustMike
26120

Random bytes example

public static class RandomUtils
{
	public static string generateBytes(int count)
	{
		Random random = new Random();
		byte[] result = new byte[count];

		random.NextBytes(result);

		return result;
	}
}

Example:

string bytes = RandomUtils.generateBytes(6);

foreach(byte entry in bytes)
	Console.Write(entry + " ");

Console.WriteLine();

Output:

34 4 1 197 85 145
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