initial commit
This commit is contained in:
13
pkg/crypto/hash.go
Normal file
13
pkg/crypto/hash.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user