func calculateHash(input string) string {
  enc := sha1.Sum([]byte(strings.ToLower(input)))
  return hex.EncodeToString(enc[:])
}
calculates a unified cache for a given input value (typically for primitive built-in cache types)
package storage
import (
  "crypto/sha1"
  "encoding/hex"
  "strings"
  "time"
)
type expirationWrapper struct {
  content   interface{}
  createdAt time.Time
}
func (w *expirationWrapper) isValid(ttl time.Duration) bool {
  return time.Since(w.createdAt) <= ttl
}