On Jan 16, 1:20 am, Paul Rubin <http://phr...@nospam.invalid> wrote: > gert <gert.cuyk...@gmail.com> writes: > > s = sha1(random()).hexdigest() > > > TypeError: object supporting the buffer API required, > > > How does sha1 work in python3.0 please ? > > sha1 hashes strings, not numbers. Try using str(random()). But if > you want some random hex digits, try os.urandom(10).encode('hex') > rather than messing with sha1.
s = urandom(10).encode('hex') AttributeError: 'bytes' object has no attribute 'encode' -- http://mail.python.org/mailman/listinfo/python-list