hi-server/pkg/tool/etag.go
2025-10-10 07:13:36 -07:00

12 lines
166 B
Go

package tool
import (
"crypto/sha256"
"encoding/hex"
)
func GenerateETag(data []byte) string {
hash := sha256.Sum256(data)
return hex.EncodeToString(hash[:])
}