From 77b167ceae8904d827571a0ba7bfa13fac28a40e Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 19 Mar 2015 16:41:39 +0100 Subject: Regression. --- utilities.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 utilities.go (limited to 'utilities.go') 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 +} -- cgit v1.2.3