补充日志

新增string的hash成数字
This commit is contained in:
boyce
2019-03-21 12:32:43 +08:00
parent c04894c404
commit 4216dd1527
2 changed files with 11 additions and 1 deletions

7
util/hash/hash.go Normal file
View File

@@ -0,0 +1,7 @@
package hash
import "hash/crc32"
func HashNumber(s string) uint {
return uint(crc32.ChecksumIEEE([]byte(s)))
}