random - Randomly generated hexadecimal number in C# -


How can I generate a random hexadecimal number with the length of my choice using C #?

  static random random = new random (); Public static string GetRandomHexNumber (int issue) {byte [buffer = new byte [number / 2]; Random.NextBytes (buffer); String result = string.concat (select buffer (x => x.ToString ("X2"). ToArray ()); If returns (number% 2 == 0) returns results; Return Results + Random Next (16). Ostring ("X"); }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -