taskcafe/internal/util/token.go
Jordan Knott 64093e19f6 redesign
2022-05-06 16:44:31 -05:00

15 lines
230 B
Go

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
}