SORT BY:

LIST ORDER
THREAD
AUTHOR
SUBJECT


SEARCH

IPS HOME


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

    RE: base64 byte-length formula



    Julian,
     
    I was using the formula in 12-97 as I stated. The formulas on 12-96 page 70, 12-97 page 71 and 12-98 page 71 all look the same to me. Changing to Martin's formula will solve the problem as would removing the formula altogether.
     
    Regards,
    Pat
     
     -----Original Message-----
    From: Julian Satran [mailto:Julian_Satran@il.ibm.com]
    Sent: Thursday, June 13, 2002 5:57 AM
    To: pat_thaler@agilent.com
    Cc: ips@ece.cmu.edu; mkrikis@yahoo.com; owner-ips@ece.cmu.edu
    Subject: RE: base64 byte-length formula


    Pat,

    I think you are talking about the formula in 12-96 and I am talking about the one in 12-98.
    Martins formula and mine are equivalent for good encodings.
    As I said I made it up only to account for encodings that are in fact impossible - like 1, 4 ... 4*n+1 base 64 digits.
    And I will  put in Martins formula with a note about the impossible numbers.
    Can we stop this thread?

    Julo


    pat_thaler@agilent.com

    06/13/2002 03:33 AM
    Please respond to pat_thaler

           
            To:        Julian Satran/Haifa/IBM@IBMIL, mkrikis@yahoo.com
            cc:        ips@ece.cmu.edu, owner-ips@ece.cmu.edu
            Subject:        RE: base64 byte-length formula

           


    Julian,

    The formula in 12-97 is:
    ((the integer part of)((n+3)*3/4) - m)

    Martins formula 3*3/4 where / indictates integer divide.

    The encoding of 1 octet in base64 results in 2 characters plus 2 equal
    signs.
    n=2, m=2.

    Martins formula = 2 *3/4 = 1 (truncated to an integer)  right answer

    integer part of ((2+3)*3/4)-1 = (integer part of 15/4) - 2 = 3 - 2 = 1 right
    answer


    The encoding of 2 octets in base64 results in 3 characters plus one equal
    sign.
    n=3, m=1.

    Martins formula = 3 *3/4 = 2 (truncated to an integer)  right answer

    integer part of ((3+3)*3/4)-1 = (integer part of 18/4) -1 = 4 - 1 = 3 wrong
    answer

    The encoding of 3 octets in base64 results in 4 characters plus no equal
    sign.
    n=4, m=0.

    Martins formula = 4 *3/4 = 3 (truncated to an integer)  right answer

    integer part of ((4+3)*3/4)-1 = (integer part of 21/4) -0 = 5 - 1 = 4 wrong
    answer

    Pat

    -----Original Message-----
    From: Julian Satran [mailto:Julian_Satran@il.ibm.com]
    Sent: Wednesday, June 12, 2002 4:56 PM
    To: Martins Krikis
    Cc: ips@ece.cmu.edu; owner-ips@ece.cmu.edu
    Subject: Re: base64 byte-length formula



    I said already that your formula is correct.
    I do not understand why you say that the 2 formulas are not equivalent for
    all the lengths (good aor bad)?
    I would appreciate if you respond although you don't have to.

    Julo


    Martins Krikis <mkrikis@yahoo.com>
    Sent by: owner-ips@ece.cmu.edu
    06/13/2002 02:34 AM
    Please respond to Martins Krikis
           
           To:        Julian Satran/Haifa/IBM@IBMIL
           cc:        ips@ece.cmu.edu
           Subject:        Re: base64 byte-length formula

         



    --- Julian Satran <Julian_Satran@il.ibm.com> wrote:

    > The difference between our formulas is that I
    > (mistakenly) took 1 digit as
    > a possible string (or 5, 9 etc.)
    > For those you need the +3 TERM.
    >
    > For all the good length 2,3,4 6,7,8 etc the two
    > formulas are equivalent.

    No they are not. They are only equivalent for
    n = 0 (mod 4). So I'm still insisting that
    n * 3 / 4 is the simplest right formula.

    Martins Krikis, Intel Corp.

    Disclaimer: these are my opinions and
              may not be Intel's.


    __________________________________________________
    Do You Yahoo!?
    Yahoo! - Official partner of 2002 FIFA World Cup
    http://fifaworldcup.yahoo.com




Home

Last updated: Thu Jun 13 13:18:41 2002
10757 messages in chronological order