优化ttlcache相关代码

This commit is contained in:
刘祥超
2024-05-08 11:10:56 +08:00
parent 5020985b96
commit f1b3a7463d
15 changed files with 77 additions and 44 deletions

View File

@@ -0,0 +1,11 @@
package ttlcache
import "github.com/cespare/xxhash/v2"
func HashKeyBytes(key []byte) uint64 {
return xxhash.Sum64(key)
}
func HashKeyString(key string) uint64 {
return xxhash.Sum64String(key)
}