ServiceStack.HashUtils.GetHashAlgorithm C# (CSharp) Method

GetHashAlgorithm() public static method

public static GetHashAlgorithm ( string hashAlgorithm ) : HashAlgorithm
hashAlgorithm string
return System.Security.Cryptography.HashAlgorithm
        public static HashAlgorithm GetHashAlgorithm(string hashAlgorithm)
        {
            switch (hashAlgorithm)
            {
                case "SHA1":
                    return SHA1.Create();
                case "SHA256":
                    return SHA256.Create();
                case "SHA512":
                    return SHA512.Create();
                default:
                    throw new NotSupportedException(hashAlgorithm);
            }
        }
    }