Audit the random number generation source (rand) GSC-G404
Security
Minor
6 months ago2 years old
Use of weak random number generator (math/rand instead of crypto/rand)
597
598// NewWithSeed returns a new instance of Faker instance with a given seed
599func NewWithSeed(src rand.Source) (f Faker) {
600	generator := rand.New(src)601	f = Faker{Generator: generator}
602	return
603}
Use of weak random number generator (math/rand instead of crypto/rand)
17func (YouTube) GenerateVideoID() (videoID string) {
18	b := make([]byte, 11)
19	for i := range b {
20		b[i] = charset[rand.Intn(len(charset))]21	}
22	return string(b)
23}