Created
September 7, 2019 22:26
-
-
Save kanzitelli/35c1a6cba86abf2fe9f2dbbd821ed73b to your computer and use it in GitHub Desktop.
Utils/Hash.go. #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
import ( | |
"crypto/sha1" | |
"encoding/hex" | |
) | |
// MakeHash <function> | |
// is used to create hash from string | |
func MakeHash(s string) string { | |
h := sha1.New() | |
h.Write([]byte(s)) | |
return hex.EncodeToString(h.Sum(nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment