An unusual task arose, can be considered for convenience that it is associated with encryption.
Suppose there is a file, absolutely any (take binary). You need a hex number that represents the contents of the site, translate to decimal. Stumbled on two things:
a) Algorithms familiar to me record the intermediate version of the maximum in Long Long or their array, and the number for a file in a pair of kilo (or even the mega-) byte in any variable, except for the text, will not fit.
b) optimization, i.e. First of all, I would like to accelerate the process. If the first thoughts are the first thoughts – the processor will be surprised.
Actually, I would like to read your thoughts about the algorithm (ideally C / C++ / PHP). You can take on the go to stdout.
Example of translation – ‘yay’ (0xFFFE) = & gt; ‘65534’;
Answer 1, Authority 100%
If you need a giant number, then use BCD . BCD is a classic to work with large numbers. In addition, just a decimal representation will get almost nahalava.
In addition, Java has BigInteger. He can ask any size and work with it just as with a number. I do not know about PHP, but for C accurately there must be a library to work with gigantic numbers. Unfortunately, I do not remember with the go any one.