aboutsummaryrefslogtreecommitdiff
path: root/utils/transformers/tokens.go
blob: 7ad36edf6b855e3fab8201d7a8754c56acf63d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package transformers

import (
	"crypto/rand"
	"encoding/hex"
)

func GenerateRandomToken() (string, error) {
	bytes := make([]byte, 32)
	if _, err := rand.Read(bytes); err != nil {
		return "", err
	}
	return hex.EncodeToString(bytes), nil
}