fix: create RandomGenerator interface and struct for testing purpose #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user