优化ttlcache相关代码

This commit is contained in:
GoEdgeLab
2024-05-08 11:10:56 +08:00
parent d52b34606d
commit 77ba4c7fe9
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)
}