HashKey hashes key into something you can store in memcached.
(key string)
| 265 | |
| 266 | // HashKey hashes key into something you can store in memcached. |
| 267 | func HashKey(key string) string { |
| 268 | hasher := fnv.New64a() |
| 269 | _, _ = hasher.Write([]byte(key)) // This'll never error. |
| 270 | |
| 271 | // Hex because memcache errors for the bytes produced by the hash. |
| 272 | return hex.EncodeToString(hasher.Sum(nil)) |
| 273 | } |