fix: for AI review problems

This commit is contained in:
wzxjohn
2025-07-10 20:55:43 +08:00
parent d6ed2ab3e0
commit 8cc747ef22
5 changed files with 24 additions and 35 deletions

View File

@@ -7,20 +7,20 @@ import (
"encoding/hex"
)
func Sha256Raw(data string) []byte {
func Sha256Raw(data []byte) []byte {
h := sha256.New()
h.Write([]byte(data))
h.Write(data)
return h.Sum(nil)
}
func Sha1Raw(data []byte) []byte {
h := sha1.New()
h.Write([]byte(data))
h.Write(data)
return h.Sum(nil)
}
func Sha1(data string) string {
return hex.EncodeToString(Sha1Raw([]byte(data)))
func Sha1(data []byte) string {
return hex.EncodeToString(Sha1Raw(data))
}
func HmacSha256Raw(message, key []byte) []byte {