1
0

Add time for better randomisation for a hash.

This commit is contained in:
Alexander Andreev 2023-08-06 07:33:34 +04:00
parent 3f16c3e799
commit 92212c97eb
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -92,6 +92,7 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
fHash := hex.EncodeToString(s256.Sum(nil)) fHash := hex.EncodeToString(s256.Sum(nil))
s256.Write([]byte(h.hashSalt)) s256.Write([]byte(h.hashSalt))
s256.Write([]byte(time.Now().String()))
fSaltedHash := base64.RawURLEncoding.EncodeToString(s256.Sum(nil)) fSaltedHash := base64.RawURLEncoding.EncodeToString(s256.Sum(nil))
f.Seek(0, io.SeekStart) f.Seek(0, io.SeekStart)