fix: create RandomGenerator interface and struct for testing purpose #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s

This commit is contained in:
2024-10-05 13:49:43 +02:00
parent 6ccae26aea
commit f7934f42db
6 changed files with 125 additions and 55 deletions

View File

@@ -1,16 +0,0 @@
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
}