Skip to content

Commit

Permalink
Replaced math/rand (deprecated) with crypto/rand
Browse files Browse the repository at this point in the history
  • Loading branch information
acidvegas committed Dec 27, 2023
1 parent 14e9474 commit 7cc0152
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"crypto/rand"
"io"
"math/rand"
"net/http"
"os"
"strconv"
Expand Down Expand Up @@ -138,7 +138,6 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
}
file.Seek(0, 0)


// Check if expiry time is present and length is too long
if r.PostFormValue("expiry") != "" {
ttl, err = strconv.ParseInt(r.PostFormValue("expiry"), 10, 64)
Expand Down Expand Up @@ -177,7 +176,6 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
fileNameLength = conf.FileLen
}


// generate + check name
for {
id := NameGen(fileNameLength)
Expand Down

0 comments on commit 7cc0152

Please sign in to comment.