fix: refactor random
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 45s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 1m11s

This commit was merged in pull request #179.
This commit is contained in:
2024-09-13 17:06:29 +02:00
parent 63ddf77d6a
commit 1476aa9842
2 changed files with 21 additions and 12 deletions

16
utils/ctypto.go Normal file
View File

@@ -0,0 +1,16 @@
package utils
import (
"crypto/rand"
"encoding/base64"
)
func RandomToken() (string, error) {
b := make([]byte, 32)
_, err := rand.Read(b)
if err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(b), nil
}