File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Java code to convert Base10 number to Base64 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java code to convert Base10 number to Base64" Watch "Java code to convert Base10 number to Base64" New topic
Author

Java code to convert Base10 number to Base64

Arun Prabhudas
Greenhorn

Joined: Jun 05, 2012
Posts: 2
The only thing is that my Base10 number is almost 20-22 digits long. Is there some code or package I can use
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Welcome to the Ranch
What is the format for base64 numbers?
The easiest way to convert it is probably to convert the decimal to binary and then group the bits in sixes. If your number is a BigInteger, you can probably get its octal or hexadecimal representation as a String from one of its methods.
Arun Prabhudas
Greenhorn

Joined: Jun 05, 2012
Posts: 2
The requirements is to compress 20-22 digit base 10 to 12 digit Base64. For example;
Before convert (Base10): 1234567890123456789012
After convert (Base64): Niww28wSbO9k
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
. . . and what do the different letters represent? Which represents 62 and which 63?
What have you tried?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java code to convert Base10 number to Base64