utils/random.go
2a29bf62
 package utils
 
 import (
 	"crypto/rand"
 	"encoding/hex"
6998c3c3
 	"io"
2a29bf62
 )
 
 func RandomString() string {
 	id := make([]byte, 32)
a7b60b21
 
 	if _, err := io.ReadFull(rand.Reader, id); err != nil {
2a29bf62
 		panic(err) // This shouldn't happen
 	}
 	return hex.EncodeToString(id)
 }