WaveBox.Core.Model.User.GeneratePasswordSalt C# (CSharp) Method

GeneratePasswordSalt() public static method

public static GeneratePasswordSalt ( ) : string
return string
        public static string GeneratePasswordSalt()
        {
            // Create byte array to store salt
            byte[] salt = new byte[32];

            // Fill array using RNG
            using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
            {
                rng.GetBytes(salt);
            }

            // Return string representation
            return Convert.ToBase64String(salt);
        }