summaryrefslogtreecommitdiff
path: root/pkg/pls/random.go
blob: f7935f127b4f9ab18956ee6e9e2aab13bbfef0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package pls

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

func GenerateRandomHex(length int) string {
	nonceBytes := make([]byte, length)
	rand.Read(nonceBytes)
	return hex.EncodeToString(nonceBytes)
}