I'm trying to convert arbitrary long decimals (encoded as a string of
digits) to it's hex representation (i.e. a string of hexadecimal
digits). For short decimals, format('%x') is the way to go. That
looses out however for e.g. '5766297887677882160' because we loose
precision when it's internally converted to a (floating point) number:
it returns '50060160b0202000' instead of '50060160b0201f30'.
So please help me out. Here is what I came up with, is that correct or
is there a better/faster way to do it (I know that BigNum can do it, but
this is not pure Lua).