函数原型

func hmacSha(v1 string/bytes, s1 string, s2 string)string

参数介绍

参数名称参数介绍
v1待加密数据
s1密码
s2加密方式

举例

待转换数据密码加密方式转换语句输出结果
admin123sha1hmacSha("admin","123","sha1")626db268028b3256e6fbcc90ea6214f2435f7d5d
admin123sha224hmacSha(b"admin","123","sha224")e5766f1372cc989ee270f7bc04a6f8366360f9a7d0b74b899d396d1e

支持的加密方式:sha1sha224sha256sha384sha512

Was this page helpful?