loading...

re: How do you do random? VIEW POST

FULL DISCUSSION
 

Python:

import random
random.randint(0, 10)

Ruby:

rand(11)

Go:

import "math/rand"

func main() {
    rand.Intn(11)
}

None of these are cryptographically secure though

 

Python has a cryptographically secure library called "secrets", which I use a lot :-P

 

Yeah secrets is very useful and has a clear API

code of conduct - report abuse