Fastest Dec to Hex and Hex to Dec conversions
Monkey Forums/Monkey Code/Fastest Dec to Hex and Hex to Dec conversions
| ||
This is Unlike most dec to hex (and vice-versa) things, I always like to have both Big Endian and Little Endian bit order. The functions are named accordingly with the abbreviations BE and LE. BE = Big Endian LE = Little Endian Dec to Hex Hex to Dec Example usage / testing... Hex to Dec Dec to Hex Do you need proof that it's working and is faster than everyone else's solutions? Here, try for yourself. I even added the links to said functions from the other users. CODE ~ This has the testing lines so that you can see (and test if need be) that I did not obscure the results, as I have no reason to lie about how much faster my functions are. OUTPUT ~ This has the first 5 confirming lines that make sure each function does as it says it does. Second bit is the test from each of the functions. BE and LE ones are mine. Notice they are quite a bit faster. |