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("-", "");
        }

  

posted on 2016-12-23 10:37  邢帅杰  阅读(1199)  评论(0编辑  收藏  举报