Candor.Security.Cryptography.SHA2HashProvider.GetSalt C# (CSharp) Method

GetSalt() public method

Creates a true random salt.
public GetSalt ( int length ) : string
length int length of the salt to return
return string
        public override string GetSalt(int length)
        {
            RNGCryptoServiceProvider random = new RNGCryptoServiceProvider();
            Byte[] salt = new Byte[length / 2];
            random.GetBytes(salt);
            return BytesToHex(salt);
        }