diff --git a/cache.go b/cache.go index c5fecae..da5b98a 100644 --- a/cache.go +++ b/cache.go @@ -3,7 +3,6 @@ package httpcache import ( "bufio" "bytes" - "crypto/sha256" "errors" "fmt" "io" @@ -16,6 +15,7 @@ import ( "strings" "time" + "hash/fnv" "github.com/rainycape/vfs" ) @@ -190,8 +190,8 @@ func (c *Cache) Freshen(res *Resource, keys ...string) error { } func hashKey(key string) string { - h := sha256.New() - io.WriteString(h, key) + h := fnv.New64a() + h.Write([]byte(key)) return fmt.Sprintf("%x", h.Sum(nil)) }