Start of big cleanup

This commit is contained in:
2024-04-21 01:24:47 +02:00
parent e7800492c3
commit 6e3c40ccb5
6 changed files with 172 additions and 145 deletions

15
utils.go Normal file
View File

@ -0,0 +1,15 @@
package main
import (
"crypto/rand"
"encoding/base64"
)
func GenerateRandomString(len int) (string, error) {
bin := make([]byte, len)
_, err := rand.Read(bin)
if err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(bin), nil
}