From d0ff1b2d04fc0caf57d99f1d34ce13cf4aae6a1a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 27 Mar 2019 07:18:52 -0700 Subject: reorg: phase 1 --- internal/hash.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 internal/hash.go (limited to 'internal/hash.go') diff --git a/internal/hash.go b/internal/hash.go new file mode 100644 index 0000000..ee333da --- /dev/null +++ b/internal/hash.go @@ -0,0 +1,14 @@ +package internal + +import ( + "crypto/md5" + "fmt" +) + +// Hash is a simple wrapper around the MD5 algorithm implementation in the +// Go standard library. It takes in data and a salt and returns the hashed +// representation. +func Hash(data string, salt string) string { + output := md5.Sum([]byte(data + salt)) + return fmt.Sprintf("%x", output) +} -- cgit v1.2.3