Skip to content

Instantly share code, notes, and snippets.

@kanzitelli
Created September 7, 2019 22:26
Show Gist options
  • Save kanzitelli/35c1a6cba86abf2fe9f2dbbd821ed73b to your computer and use it in GitHub Desktop.
Save kanzitelli/35c1a6cba86abf2fe9f2dbbd821ed73b to your computer and use it in GitHub Desktop.
Utils/Hash.go. #1
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