This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 37953
    
  22
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: 37953
    
  22
. . . 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
 
Similar Threads
>> operator
Unicode
where >>> comes
how do i declare an int in binary format?
Hello all...new here and a question...