>- see footer for list info -<
Thanks Adam!!!!

That's cracked it a treat, any chance of a function that would reverse the
process from 02P5 to 9925?????

Always believed that you don't get if you don't ask, no matter how cheeky it
is!!!!!

Also, when converting 9925, if returned 2P5 but without the leading '0'
don't know how much of an issue this will be ultimately, could always check
the length and just prepend a '0' if only 3 char but not a nice fix by any
means.

Lee Fortnam

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adam Cameron
Sent: 12 April 2006 18:22
To: Coldfusion Development
Subject: RE: [CF-Dev] Urgent - Base64 Arithmetic

>- see footer for list info -<
Use this (seems to work):

function formatBase64(n){
        var sResult = "";
        var lNumerals =
"[EMAIL PROTECTED]";
        var iNumber = arguments.n;
        var iRemainder = 0;
        
        while (iNumber ge 64){
                iRemainder = iNumber mod 64;
                sResult = mid(lNumerals, iif(iRemainder, iRemainder, 64), 1)
& sResult;
                iNumber = iNumber \ 64; 
        }               
        sResult =  mid(lNumerals, iif(iNumber, iNumber, 64), 1) & sResult;
        return sResult;
}

--
Adam
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help 
>-<

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to