Working auth system

This commit is contained in:
2022-06-11 16:56:39 +02:00
parent b0f4eb069e
commit 6a692fdf5f
20 changed files with 474 additions and 76 deletions
+1
View File
@@ -0,0 +1 @@
package util
+18
View File
@@ -0,0 +1,18 @@
package util
import (
"crypto/rand"
"encoding/base64"
"log"
)
func GenerateRandomString(n int) string {
b := make([]byte, n)
_, err := rand.Read(b)
if err != nil {
log.Fatal(err)
}
return base64.URLEncoding.EncodeToString(b)
}