mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-09 12:11:03 +00:00
15 lines
261 B
Go
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)
|
|
}
|