I have very large numbers, and decided to represent them with base64 strings in php. I was wondering if anyone knows of a library (or built in system) to work with base64 as numbers (aka add, subtract, multiply, divide, etc)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally it does not make much sense to speak about operations on numbers in one specific base or another. Rather, you decode your numbers to a more useful or generalized representation (e.g. a string of decimal digits) and then perform work, re-encoding your result for storage as necessary.
The Math_BigInteger library facilitates this. You will of course still have to first decode your base64 data to a base usable by the class, i.e., binary, decimal, or hexidecimal.