mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-18 12:59:31 +00:00
``` $ gvt fetch -tag v1.1.0 github.com/weaveworks/promrus 2017/10/08 XX:XX:XX Fetching: github.com/weaveworks/promrus 2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/julienschmidt/httprouter 2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/go-kit/kit/log 2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/go-stack/stack 2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/go-logfmt/logfmt 2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/kr/logfmt 2017/10/08 XX:XX:XX · Skipping (existing): gopkg.in/yaml.v2 2017/10/08 XX:XX:XX · Fetching recursive dependency: gopkg.in/alecthomas/kingpin.v2 2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/alecthomas/units 2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/alecthomas/template 2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/net/context/ctxhttp 2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/stretchr/objx 2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/net/context 2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/pkg/errors ```
15 lines
273 B
Go
15 lines
273 B
Go
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))
|
|
}
|