security.go raw

   1  package objx
   2  
   3  import (
   4  	"crypto/sha1"
   5  	"encoding/hex"
   6  )
   7  
   8  // HashWithKey hashes the specified string using the security key
   9  func HashWithKey(data, key string) string {
  10  	d := sha1.Sum([]byte(data + ":" + key))
  11  	return hex.EncodeToString(d[:])
  12  }
  13