hardfiles

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README | LICENSE

commit 7cc0152d3eb97b184d3080554a1091955d2fe253
parent 14e947435b452a37ea6e83e3ecc6e66a8733540d
Author: acidvegas <acid.vegas@acid.vegas>
Date: Wed, 27 Dec 2023 15:01:43 -0500

Replaced math/rand (deprecated) with crypto/rand

Diffstat:
Mmain.go | 4+---

1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/main.go b/main.go
@@ -1,8 +1,8 @@
 package main
 
 import (
+	"crypto/rand"
 	"io"
-	"math/rand"
 	"net/http"
 	"os"
 	"strconv"
@@ -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)
@@ -177,7 +176,6 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
 		fileNameLength = conf.FileLen
 	}
 
-
 	// generate + check name
 	for {
 		id := NameGen(fileNameLength)