mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Use rand.Seed to seed the random function generator (#6)
* Blacklist some sytest tests that are failing in our environment * Commenting out test that isn't reliably passing or failing, probably a race * refresh latest dendrite main * use rand.Seed to seed the random function Co-authored-by: Brian Meek <brian@hntlabs.com> Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
This commit is contained in:
parent
0f3c17d16e
commit
93ebd46aca
|
|
@ -2,6 +2,7 @@ package config
|
|||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
|
||||
)
|
||||
|
|
@ -72,6 +73,7 @@ const lettersAndNumbers = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0
|
|||
|
||||
func newNonce(n int) string {
|
||||
nonce := make([]byte, n)
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
for i := range nonce {
|
||||
nonce[i] = lettersAndNumbers[rand.Int63()%int64(len(lettersAndNumbers))]
|
||||
|
|
|
|||
Loading…
Reference in a new issue