1 Star 0 Fork 0

蒲杰 / canal-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
security_util.go 512 Bytes
一键复制 编辑 原始数据 按行查看 历史
jackey.pu 提交于 2021-04-16 17:00 . Init
package client
import (
"crypto/sha1"
"encoding/hex"
)
func Scramble411(data *[]byte, seed *[]byte) []byte {
crypt := sha1.New()
//stage1
crypt.Write(*data)
stage1 := crypt.Sum(nil)
//stage2
crypt.Reset()
crypt.Write(stage1)
stage2 := crypt.Sum(nil)
//stage3
crypt.Reset()
crypt.Write(*seed)
crypt.Write(stage2)
stage3 := crypt.Sum(nil)
for i := range stage3 {
stage3[i] ^= stage1[i]
}
return stage3
}
func ByteSliceToHexString(data []byte) string {
return hex.EncodeToString(data)
}
1
https://gitee.com/bhpujie/canal-go.git
git@gitee.com:bhpujie/canal-go.git
bhpujie
canal-go
canal-go
f553f2580d95

搜索帮助