OSDN Git Service

Hulk did something
[bytom/vapor.git] / vendor / github.com / stretchr / testify / vendor / github.com / stretchr / objx / security.go
1 package objx
2
3 import (
4         "crypto/sha1"
5         "encoding/hex"
6 )
7
8 // HashWithKey hashes the specified string using the security
9 // key.
10 func HashWithKey(data, key string) string {
11         hash := sha1.New()
12         hash.Write([]byte(data + ":" + key))
13         return hex.EncodeToString(hash.Sum(nil))
14 }