2020-06-26 14:58:47 +00:00
package testdata
import (
"math/rand"
mathRand "math/rand"
"time"
)
2021-04-23 12:06:05 +00:00
// UseRandNew --
2020-06-26 14:58:47 +00:00
func UseRandNew ( ) {
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
source := rand . NewSource ( time . Now ( ) . UnixNano ( ) ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
randGenerator := mathRand . New ( source ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
start := uint64 ( randGenerator . Intn ( 32 ) )
_ = start
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
source = rand . NewSource ( time . Now ( ) . UnixNano ( ) ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
randGenerator = rand . New ( source ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
}
2021-04-23 12:06:05 +00:00
// UseWithoutSeed --
2020-06-26 14:58:47 +00:00
func UseWithoutSeed ( ) {
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
assignedIndex := rand . Intn ( 128 ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
_ = assignedIndex
}