C# SHA256

        public static string SHA256Hash(string str)
        {
            byte[] data = Encoding.UTF8.GetBytes(str);
            SHA256 shaM = new SHA256Managed();
            var hashBytes = shaM.ComputeHash(data);
            return Convert.ToBase64String(hashBytes);
        }

 

posted @ 2019-10-15 18:43  路边有一棵草  阅读(3955)  评论(0编辑  收藏  举报