On May 12, 4:20 am, Maarten wrote:
> On May 12, 6:04 am, Leo Jay wrote:
>
> > I'd like to encode a string in base64, but I found a inconsistent of
> > two methods:
>
> > >>> 'aaa'.encode('base64')
> > 'YWFh\n'
> > >>> import base64
> > >>> base64.b64encode('aaa')
> > 'YWFh'
>
> > as you can see,
On May 12, 6:04 am, Leo Jay wrote:
> I'd like to encode a string in base64, but I found a inconsistent of
> two methods:
>
> >>> 'aaa'.encode('base64')
> 'YWFh\n'
> >>> import base64
> >>> base64.b64encode('aaa')
> 'YWFh'
>
> as you can see, the result of
> 'aaa'.encode('base64')
> has a '\n' at t
I'd like to encode a string in base64, but I found a inconsistent of
two methods:
>>> 'aaa'.encode('base64')
'YWFh\n'
>>> import base64
>>> base64.b64encode('aaa')
'YWFh'
>>>
as you can see, the result of
'aaa'.encode('base64')
has a '\n' at the end, but the other method doesn't.
Why the incons