mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 08:55:31 +01:00
initial refactor-servers commit
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package token
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
@@ -20,3 +21,10 @@ func Generate(length int) string {
|
||||
func RNG() *rand.Rand {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
}
|
||||
|
||||
// RandBytes returns x random bytes
|
||||
func RandBytes(x int) []byte {
|
||||
y := make([]byte, x)
|
||||
crand.Read(y)
|
||||
return y
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user