summaryrefslogtreecommitdiff
path: root/utilities.go
blob: a090ea7e9fa10650b2ddeecd7a3c9f1713b11d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}