allegro / allegro/bigcache

Optional Hasher for int64 type

Abierto
#130 4 comentarios 6 reacciones 0 asignados Ver en GitHub
enhancement question
Lenguaje dominante
Go
Estrellas
8.2k
Forks
614
Merge medio
5 d 12 h
PR fusionados (30 d)
1

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.