mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-28 04:41:09 +00:00
12 lines
201 B
Go
12 lines
201 B
Go
package hash
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func New(text, salt string) string {
|
|
hasher := sha256.New()
|
|
hasher.Write([]byte(text + salt))
|
|
return hex.EncodeToString(hasher.Sum(nil))
|
|
}
|