14 lines
228 B
Go
14 lines
228 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
"fmt"
|
|
)
|
|
|
|
func Sha256(identifier string) string {
|
|
hash := sha256.Sum256([]byte(identifier))
|
|
hashStr := hex.EncodeToString(hash[:])
|
|
return fmt.Sprintf("%s", hashStr)
|
|
}
|