summaryrefslogtreecommitdiff
path: root/go/vendor/github.com/stretchr/objx/security.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-01-15 23:36:21 +0000
committerNick Thomas <nick@gitlab.com>2019-01-15 23:36:21 +0000
commit1fcb56f42cdb2b6f562d8875abc4e33f7ef3e258 (patch)
treec246e5b43a1e7b5744e10e75d6ed125629f45936 /go/vendor/github.com/stretchr/objx/security.go
parent6c5b195353a632095d7f672d28b9985fd879b077 (diff)
parentd762f4ec9ea35cb00309b41ad60055cd3c5709ba (diff)
downloadgitlab-shell-1fcb56f42cdb2b6f562d8875abc4e33f7ef3e258.tar.gz
Merge branch 'bvl-feature-flag-commands' into 'master'
Parse commands to enable feature flags See merge request gitlab-org/gitlab-shell!270
Diffstat (limited to 'go/vendor/github.com/stretchr/objx/security.go')
-rw-r--r--go/vendor/github.com/stretchr/objx/security.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/go/vendor/github.com/stretchr/objx/security.go b/go/vendor/github.com/stretchr/objx/security.go
new file mode 100644
index 0000000..692be8e
--- /dev/null
+++ b/go/vendor/github.com/stretchr/objx/security.go
@@ -0,0 +1,12 @@
+package objx
+
+import (
+ "crypto/sha1"
+ "encoding/hex"
+)
+
+// HashWithKey hashes the specified string using the security key
+func HashWithKey(data, key string) string {
+ d := sha1.Sum([]byte(data + ":" + key))
+ return hex.EncodeToString(d[:])
+}