2018-05-04 23:13:40 +00:00
|
|
|
package objx
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/sha1"
|
|
|
|
"encoding/hex"
|
|
|
|
)
|
|
|
|
|
2020-01-31 16:19:37 +00:00
|
|
|
// HashWithKey hashes the specified string using the security key
|
2018-05-04 23:13:40 +00:00
|
|
|
func HashWithKey(data, key string) string {
|
2020-01-31 16:19:37 +00:00
|
|
|
d := sha1.Sum([]byte(data + ":" + key))
|
|
|
|
return hex.EncodeToString(d[:])
|
2018-05-04 23:13:40 +00:00
|
|
|
}
|