mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-02 18:12:15 +00:00
cmn: fix race condition in prng
This commit is contained in:
parent
c8ddf156a7
commit
a25ed5ba1b
@ -40,7 +40,7 @@ func RandStr(length int) string {
|
|||||||
chars := []byte{}
|
chars := []byte{}
|
||||||
MAIN_LOOP:
|
MAIN_LOOP:
|
||||||
for {
|
for {
|
||||||
val := prng.Int63()
|
val := RandInt63()
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
v := int(val & 0x3f) // rightmost 6 bits
|
v := int(val & 0x3f) // rightmost 6 bits
|
||||||
if v >= 62 { // only 62 characters in strChars
|
if v >= 62 { // only 62 characters in strChars
|
||||||
|
Loading…
x
Reference in New Issue
Block a user