C# HMACSHA1 加密

来源:互联网 发布:广西都市频道网络电视 编辑:程序博客网 时间:2024/05/29 06:43
            HMACSHA1 hmacsha1 = new HMACSHA1();
            hmacsha1.Key = Encoding.UTF8.GetBytes(secret);
            byte[] dataBuffer = Encoding.UTF8.GetBytes(mk); 
            byte[] hashBytes = hmacsha1.ComputeHash(dataBuffer);
            return Convert.ToBase64String(hashBytes);
原创粉丝点击