mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-27 01:50:30 +08:00
优化ttlcache相关代码
This commit is contained in:
11
internal/utils/ttlcache/utils.go
Normal file
11
internal/utils/ttlcache/utils.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user