octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #38974] Incorrect result in base64decode:


From: anonymous
Subject: [Octave-bug-tracker] [bug #38974] Incorrect result in base64decode:
Date: Mon, 13 May 2013 04:36:41 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3

URL:
  <http://savannah.gnu.org/bugs/?38974>

                 Summary: Incorrect result in base64decode:
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 13 May 2013 04:36:40 AM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Dave GOEl
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

It seems to me that base64decode doesn't understand padding correctly. Here,
for example, it incorrectly returns extra 0's at the end of the decoded
integers.
 
octave:203> assert(base64decode(base64encode("A")),double("A"))
error: assert (base64decode (base64encode ("A")),double ("A")) expected
 65
but got
   65    0    0
Dimensions don't match
error: called from:
error:   /usr/share/octave/3.2.4/m/testfun/assert.m at line 209, column 5



(Notice that (a) char([65 0 0]) will display as simply a on the screen,
causing you to think that you got the right answer;
(b) Simply truncating ending 0's is not right either. Sometimes, 0's are
actually expected.)









    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38974>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]