signaller/internal/random_provider.go
2019-08-04 20:46:31 +04:00

15 lines
261 B
Go

package internal
import (
"crypto/rand"
"fmt"
)
// RandomString returns new generated token with specified length
func RandomString(size int) string {
b := make([]byte, size)
rand.Read(b) // TODO: check may be can be error
return fmt.Sprintf("%x", b)
}