mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-09 20:21:03 +00:00
15 lines
251 B
Go
15 lines
251 B
Go
package memory
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
)
|
|
|
|
// newToken returns new generated token with specified length
|
|
func newToken(size int) string {
|
|
b := make([]byte, size)
|
|
rand.Read(b) // TODO: check may be can be error
|
|
|
|
return fmt.Sprintf("%x", b)
|
|
}
|