diff options
| author | Horus3 | 2015-03-19 16:41:39 +0100 |
|---|---|---|
| committer | Horus3 | 2015-03-19 16:41:39 +0100 |
| commit | 77b167ceae8904d827571a0ba7bfa13fac28a40e (patch) | |
| tree | dc320a8b89911686ebc7af79e2335968aa488e38 /utilities.go | |
| parent | e14cf986a916e1a7361b058224ef3badd3aad776 (diff) | |
| download | freemail-77b167ceae8904d827571a0ba7bfa13fac28a40e.tar.gz | |
Regression.
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 +} |
