diff options
Diffstat (limited to 'utilities.go')
| -rw-r--r-- | utilities.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/utilities.go b/utilities.go new file mode 100644 index 0000000..a090ea7 --- /dev/null +++ b/utilities.go @@ -0,0 +1,16 @@ +package main + +import ( + "crypto/md5" + "fmt" + "io" +) + +// Hashs and returns a string (md5) +func Md5Hash(content string) string { + h := md5.New() + io.WriteString(h, content) + hash := fmt.Sprintf("%x", h.Sum(nil)) + + return hash +} |
