Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (13 sloc) 270 Bytes
package hash
import (
"crypto/sha1"
"encoding/hex"
"fmt"
)
// Sha1 builds sha1 hash with proper salt
func Sha1(value, salt string) string {
value = fmt.Sprintf(salt, value)
hash := sha1.New()
hash.Write([]byte(value))
return hex.EncodeToString(hash.Sum(nil))
}
You can’t perform that action at this time.