Skip to content

Instantly share code, notes, and snippets.

@jkuemerle
Created November 18, 2013 19:03
Show Gist options
  • Select an option

  • Save jkuemerle/7533382 to your computer and use it in GitHub Desktop.

Select an option

Save jkuemerle/7533382 to your computer and use it in GitHub Desktop.
Fills a byte array with random values.
public static byte[] FillWithEntropy(this byte[] ToFill)
{
var rng = new RNGCryptoServiceProvider();
rng.GetBytes(ToFill);
return ToFill;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment