3 ms·
It would not be so tough to provide an API call with a name like "PredictableRand".
by euroderf 3y ago
It would not be so tough to provide an API call with a name like "PredictableRand".
- Cthulhu_ 3y agoOr SemiRand, UnsafeRand, that kinda thing. Bit more explicit naming. I feel like a lot of Go's naming is down to legacy / what people are used to, which on the one side is good because familiarity, but on the other it opens it up to the same mistakes and confusion that has already been made in the past.
- masklinn 3y agoThe main issue was math/rand having a `Read` utility function with the same signature as crypto/rand, compounded by packages being namespaced but the namespacing not being preserved by importing. So a call to `rand.Read()` could be cryptographic or not you'd have to check the import to be sure.
- tedunangst 3y agoIt's not so hard to do `import notrand "math/rand"` which helps avoid mistakes in the mean time.