s = sha1(random()).hexdigest()

"Martin v. Löwis" martin at v.loewis.de
Fri Jan 16 01:08:39 EST 2009


>  s = urandom(10).encode('hex')
> 
>  AttributeError: 'bytes' object has no attribute 'encode'

py> binascii.hexlify(os.urandom(10))
b'92b91d5734a9fe562f23'

Regards,
Martin



More information about the Python-list mailing list