[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17360: base64 bug of result ending founded
From: |
Eric Blake |
Subject: |
bug#17360: base64 bug of result ending founded |
Date: |
Mon, 28 Apr 2014 06:51:15 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
tag 17360 notabug
thanks
On 04/28/2014 02:56 AM, Ruediger Meier wrote:
> On Monday 28 April 2014, Алексей wrote:
>> I take some difference of results base64 command and base64 php
>> function
>>
>> *echo "111111" | base64*
>> give result
>> *MTExMTExCg==*
>
> echo prints a newline per default
> $ echo -n "111111" | base64
> MTExMTEx
>
'echo -n' is not portable; the portable spelling is:
printf 111111 | base64
But the analysis is correct - depending on whether you feed the trailing
newline as part of the buffer to be encoded, the base64 encoding is
correct either way. So I'm closing this as not a bug.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature