Is python's random number generation easily reproducible?

前端 未结 4 1682
轮回少年
轮回少年 2021-01-13 12:01

I was reading about python\'s random module in standard library. It amazes me that when I set the seed and produce a few random numbers:

random.seed(1)
for i         


        
4条回答
  •  自闭症患者
    2021-01-13 12:28

    The Python documentation has this to say:

    Warning The pseudo-random generators of this module should not be used for security purposes. Use os.urandom() or SystemRandom if you require a cryptographically secure pseudo-random number generator.

    So, using it for CAPTCHA is not likely to be a good idea.

提交回复
热议问题