2 Star 15 Fork 10

北京小程科技有限公司/Go通用工具

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hmac_sha1.go 274 Bytes
一键复制 编辑 原始数据 按行查看 历史
shallot 提交于 2020-06-07 23:20 +08:00 . 添加HMAC-SHA1加密算法。
package encrypt
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
)
// HMAC-SHA1算法
func HmacSHA1(plainText string, key string) string {
mac := hmac.New(sha1.New, []byte(key))
_, _ = mac.Write([]byte(plainText))
return hex.EncodeToString(mac.Sum([]byte("")))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/xiaochengtech/common.git
git@gitee.com:xiaochengtech/common.git
xiaochengtech
common
Go通用工具
82269be32710

搜索帮助