aboutsummaryrefslogtreecommitdiffstats
path: root/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils.go b/utils.go
new file mode 100644
index 0000000..c123565
--- /dev/null
+++ b/utils.go
@@ -0,0 +1,13 @@
+package main
+
+import (
+ "crypto/md5"
+ "encoding/hex"
+)
+
+func md5hex(b []byte) []byte {
+ hash := md5.Sum(b)
+ dst := make([]byte, hex.EncodedLen(md5.Size))
+ hex.Encode(dst, hash[:])
+ return dst
+}