summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/stretchr/objx/security.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/stretchr/objx/security.go')
-rw-r--r--vendor/github.com/stretchr/objx/security.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/stretchr/objx/security.go b/vendor/github.com/stretchr/objx/security.go
new file mode 100644
index 000000000..fdd6be9cf
--- /dev/null
+++ b/vendor/github.com/stretchr/objx/security.go
@@ -0,0 +1,14 @@
+package objx
+
+import (
+ "crypto/sha1"
+ "encoding/hex"
+)
+
+// HashWithKey hashes the specified string using the security
+// key.
+func HashWithKey(data, key string) string {
+ hash := sha1.New()
+ hash.Write([]byte(data + ":" + key))
+ return hex.EncodeToString(hash.Sum(nil))
+}