I need to convert a hexadecimal value to a decimal integer. Is there some unit that can do this?
On the web I have found something about it but it is not helping me much. I understood that using inline asm it is possible to represent it as a packed array of four 32 bit Integer. I have found as convert a int32 or int64 to int128 and viceversa, but not found nothing for take for example two int64 and to do a int128 and too i have found issue searching in asm inline something that emule div operator, mul operator and sum operator.
So I ask if someone can help me to solve this problem. My objective is to take a string in hexadecimal and convert it in decimal and after that calculate the equivalent value in base 35 (0..9, A..Z).
Thanks very much.
If you convert the hexadecimal string into an array of bytes (see SysUtils for that) you can use the follewing code to convert it into base 35:
Then transform the base 35 bytes into characters:
I don’t think you need 128 bit math..
Good luck!