aboutsummaryrefslogtreecommitdiffstats
path: root/utils.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2018-12-29 19:33:16 -0500
committerThibaut Horel <thibaut.horel@gmail.com>2018-12-29 19:33:16 -0500
commit1ed8283df70c5c2f597821fd318cbda89d2eb7ea (patch)
tree1e22ecc92066308a18b5e8226cebe2b2236acc9d /utils.go
parent22e21e02e7d333c9e613456f0c203cd167dba4b1 (diff)
downloadid-1ed8283df70c5c2f597821fd318cbda89d2eb7ea.tar.gz
Add basic user page
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
+}