Optional Hasher for int64 type
- Langage dominant
- Go
- Étoiles
- 8.2k
- Forks
- 614
- Merge moyen
- 5 j 12 h
- PR mergées (30 j)
- 1
Description
Hi, thanks for awesome work! Bigcache working beautiful in production with almost 1 million rpm :)
I'm storing items in cache based in their id (int64 type), but Hasher interface supports only `func Sum64(s string) uint64` method, and because of what I implemented it as follows:
```go
// Sum64 decodes integer from byte representation of string
func (d DummyHash) Sum64(s string) uint64 {
b := []byte(s)
x, _ := binary.Varint(b)
return uint64(x)
}
```
Overhead isn't noticable, but looks hacky. What's your thoughts on this? Did I miss something? Could we extend interface to support int64? I would love to do pr myself, with your help and advice.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.