This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mahmoudimus
Recipients mahmoudimus
Date 2011-01-21.06:25:11
SpamBayes Score 0.0015398046
Marked as misclassified No
Message-id <1295591116.22.0.262504941667.issue10970@psf.upfronthosting.co.za>
In-reply-to
Content
Given a string, encoding it with .encode('base64') is not the same as using base64's b64encode function. I think this is very unclear and unintuitive. 

Here's some example code to demonstrate the problem. Before I attempt to submit a patch, is this done for legacy reasons? Are there any reasons to use one over the other?

import hmac
import hashlib
import base64


signature = hmac.new('secret', 'url', hashlib.sha512).digest()
assert signature.encode('base64') == base64.b64encode(signature)
History
Date User Action Args
2011-01-21 06:25:16mahmoudimussetrecipients: + mahmoudimus
2011-01-21 06:25:16mahmoudimussetmessageid: <1295591116.22.0.262504941667.issue10970@psf.upfronthosting.co.za>
2011-01-21 06:25:11mahmoudimuslinkissue10970 messages
2011-01-21 06:25:11mahmoudimuscreate