这是生成密码随机的n随机字节的有效方法吗?randint(0,256)) for _ in range(n))
我知道random.SystemRandom()和os.urandom()是一样的,而且我知道os.urandom()绝对是一种产生随机数的加密安全方法由于chr()不支持unicode,所以我假设这个函数正在丢弃一些本来由random.SystemRandom()生成的字符。我也不知道如何看待randint(0,256),因为这是一个字节的大小。
我有一些代码正在使用'gdshortener‘模块来生成我的源URLS的缩短版本:import httplib2import gdshortenerfrom random import randint
print("Python will now attempt to submit tweets to twitter...")我使用随机数发生器产生六位数,然后输入到这个模块</e