Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code to convert Base10 number to Base64

 
Arun Prabhudas
Greenhorn
Posts: 2
  • 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
Posts: 51418
87
  • 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
  • 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
Posts: 51418
87
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic