Truncate IDs to a more reasonable length

This commit is contained in:
Matt Baer 2018-11-29 10:22:01 -05:00
parent 62979dbe9b
commit 77a6bc9413

View File

@ -45,7 +45,7 @@ func createPost(w http.ResponseWriter, r *http.Request) {
data := r.FormValue("stuff")
h := md5.New()
idHash := h.Sum([]byte(data))
id := base64.StdEncoding.EncodeToString(idHash)
id := base64.StdEncoding.EncodeToString(idHash)[:20]
err := ioutil.WriteFile(id+".txt", []byte(data), 0600)
if err != nil {