taskcafe/internal/util/token.go

15 lines
230 B
Go
Raw Normal View History

2022-05-06 23:41:52 +02:00
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
}