hash.go 190 B

123456789101112131415
  1. package protocol
  2. import (
  3. "crypto/hmac"
  4. "crypto/md5"
  5. "hash"
  6. )
  7. func TimestampHash() hash.Hash {
  8. return md5.New()
  9. }
  10. func IDHash(key []byte) hash.Hash {
  11. return hmac.New(md5.New, key)
  12. }