以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- SHA1加密算法 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=166172) |
-- 作者:bobolan521 -- 发布时间:2021/5/21 15:15:00 -- SHA1加密算法 Dim text1 As String = "1621577870;1621581470" Dim key1 = "3g5wXtoSAcnhJekcDXbYswUmnXwmPdaG" Dim byteData = Encoding.utf8.GetBytes(text1) Dim byteKey = Encoding.utf8.GetBytes(key1) Dim hmac = new System.Security.Cryptography.HMACSHA1(byteKey) Dim result = hmac.ComputeHash(byteData) Dim s = Convert.ToBase64String(result ) output.show(s) 老师,请问一下,代码要怎么改进,才可以算出下面的这个结果 ,和图片是的一样 计算结果: 9353afe44124e131c8f80d1d9806d014bd3acc2c [此贴子已经被作者于2021/5/21 15:15:23编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/5/21 15:29:00 -- Dim s2 As String = BitConverter.ToString(result ) output.show(s2.replace("-",""))
|
-- 作者:bobolan521 -- 发布时间:2021/5/21 15:38:00 -- 谢谢有点蓝老师! |