Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / September 2007

Tip: Looking for answers? Try searching our database.

how to coonvert decimal number  in to base 64 format

Thread view: 
naveen - 04 Aug 2007 07:11 GMT
Hi friends,
                  My requirement is how to convet a decimal number of
length 19(19 digit number) in to base 64.

the number may be
Example :

                    -123 or
                    -123.455 or
                      123 or
                     123.345
           Like that.If any one know iv JAVA API or how to do
that,please send your valueble suggestions to me.

Thanks,
Naveen
Phil G - 16 Aug 2007 13:47 GMT
> Hi friends,
>                    My requirement is how to convet a decimal number of
[quoted text clipped - 12 lines]
> Thanks,
> Naveen

How about this...?

double q = -123.456;
System.out.println(new
sun.misc.BASE64Encoder().encode(Double.toString(q).getBytes()));
double w = Double.parseDouble(new String(new
sun.misc.BASE64Decoder().decodeBuffer("LTEyMy40NTY="))); //BASE64
encoded Double q
System.out.println(w);
Sabine Dinis Blochberger - 05 Sep 2007 10:46 GMT
> > Hi friends,
> >                    My requirement is how to convet a decimal number of
[quoted text clipped - 22 lines]
> encoded Double q
> System.out.println(w);

There's a public domain Base64 class:
http://iharder.sourceforge.net/current/java/base64/

Signature

Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

Simon Eichenauer - 07 Sep 2007 15:14 GMT
Hi Naveen,

just use the Base64Encoder contained in the rt.jar of your jdk.
sun.misc.Base64Encoder

If you use eclipse just use the strg-shift-R combination and write the name.

Simon

>> > Hi friends,
>> >                    My requirement is how to convet a decimal number of
[quoted text clipped - 25 lines]
> There's a public domain Base64 class:
> http://iharder.sourceforge.net/current/java/base64/
Simon Eichenauer - 07 Sep 2007 15:16 GMT
Sorry, its ctrl-shift-R... I have a german keyboard layout.

>> > Hi friends,
>> >                    My requirement is how to convet a decimal number of
[quoted text clipped - 25 lines]
> There's a public domain Base64 class:
> http://iharder.sourceforge.net/current/java/base64/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.