GNU bug report logs - #17360
base64 bug of result ending founded

Previous Next

Package: coreutils;

Reported by: Алексей <gasx <at> rambler.ru>

Date: Mon, 28 Apr 2014 08:25:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Ruediger Meier <sweet_f_a <at> gmx.de>, 17360-done <at> debbugs.gnu.org
Subject: bug#17360: base64 bug of result ending founded
Date: Mon, 28 Apr 2014 06:51:15 -0600
[Message part 1 (text/plain, inline)]
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 (application/pgp-signature, attachment)]

This bug report was last modified 11 years and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.