File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code to convert Base10 number to Base64

 
Arun Prabhudas
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47286
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47286
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . 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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic