gopkg.in/alecthomas/gometalinter.v3@v3.0.0/_linters/src/github.com/stretchr/objx/security.go (about)

     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  }