Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
>>> Or hexdigest_string.decode('hex') >> I would advise against this, as it's incompatible with Python 3. > > I didn't know that, you actually made me look it up in the Python 3 > FAQ. And yes, the difference is that decode will return bytes type > instead of a string. No. The decode method on st

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread marek . rocki
Martin v. Löwis napisał(a): > > Or hexdigest_string.decode('hex') > > I would advise against this, as it's incompatible with Python 3. I didn't know that, you actually made me look it up in the Python 3 FAQ. And yes, the difference is that decode will return bytes type instead of a string. This ma

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
> Or hexdigest_string.decode('hex') I would advise against this, as it's incompatible with Python 3. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread marek . rocki
Martin v. Löwis napisał(a): > > How can convert string from sha1.hexdigest() to string that is the > > same, like from sha1.digest() > > Use binascii.unhexlify. > > HTH, > Martin Or hexdigest_string.decode('hex') -- http://mail.python.org/mailman/listinfo/python-list

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
> How can convert string from sha1.hexdigest() to string that is the > same, like from sha1.digest() Use binascii.unhexlify. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list