Created
July 1, 2017 10:03
-
-
Save JoeSz/65769ff30c650c136977c092982ed442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static byte[] GenerateRandomSalt() | |
{ | |
//Source: http://www.dotnetperls.com/rngcryptoserviceprovider | |
byte[] data = new byte[32]; | |
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) | |
{ | |
// Ten iterations. | |
for (int i = 0; i < 10; i++) | |
{ | |
// Fill buffer. | |
rng.GetBytes(data); | |
} | |
} | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment