goProject/trunk/goutil/stringUtil/hash.go
皮蛋13361098506 1b77f62820 初始化项目
2025-01-06 16:01:02 +08:00

17 lines
206 B
Go

package stringUtil
import (
"hash/crc32"
)
// HashCode 获取字符串对应的hashCode值
func HashCode(s string) int {
v := int(crc32.ChecksumIEEE([]byte(s)))
if v < 0 {
return -v
}
return v
}