C# SHA1散列算法

C# SHA1散列算法
/// <summary>
        /// C# SHA1散列算法
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string EncryptToSHA1(string str)
        {
            byte[] cleanBytes = Encoding.Default.GetBytes(str);
            byte[] hashedBytes = System.Security.Cryptography.SHA1.Create().ComputeHash(cleanBytes);
            return BitConverter.ToString(hashedBytes).Replace("-", "");
        }

  

原文地址:https://www.cnblogs.com/xsj1989/p/6213890.html