redesign
This commit is contained in:
14
internal/util/token.go
Normal file
14
internal/util/token.go
Normal file
@ -0,0 +1,14 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func GenerateAccessToken() (string, error) {
|
||||
b := make([]byte, 128)
|
||||
if _, err := rand.Read(b); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return hex.EncodeToString(b), nil
|
||||
}
|
Reference in New Issue
Block a user