Form sha1.hexdigest to sha1.digest

marek.rocki at wp.pl marek.rocki at wp.pl
Sun Apr 6 17:23:28 EDT 2008


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 may or may not be a problem (bytes type is
supposed to be immutable, so it can be used in many places where a
string is used now, ex. as a dict key).



More information about the Python-list mailing list