Release Date: | 29 October 2010 |

Project files: | Open GitHub repository |

Platforms: | DS1100, DS1101W, DS1102W, DS1202, DS1206, EM1000, EM1000W, EM1001W, EM1202, EM1202W, EM1206, EM1206W, EM2000W, EM500W, TPP2W, TPP2W(G2), TPP3W, TPP3W(G2) |

Library: | >2.0.0 |

Try it on: | Any programmable Tibbo device |

This library's mission in life is to help you convert very large numbers between different bases, as well as perform simple calculations on very large numbers. This can be very handy for hashing algorithms, encryption, and all sorts of other tasks that require number conversion.

We call it a library because you can easily integrate it into your projects. But since you might want to play with it without putting it into an existing project, we went ahead and put in a Web interface so you can just treat it as a full-fledged Tibbo BASIC demo app. Here's what it looks like in a browser:

The actual data type handled by the library is **string**. It receives a string, and returns a string. When performing calculations, the result is always given in the base of the first operand. So if you feed it with a Hex number first and tell it to add a decimal number, the result will be given in Hex. Here's how plain conversion works for different bases:

**Input:** A string containing a hex number, up to 211 digits in length. Its value must be lower than "DA3C0F568CC4F3E8C9E5D72D90A2741E1B081050F30E0C36A1E157ADF8F809A44AC6BCF927

620752F1B5C8C06411BBC60E1702724F1C3A380CEC7DC5F31FF9BC6B6E84EEA5046A44E0A3F

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"

**Output:** A string containing a decimal number. Scientific notation is not supported, so if you feed in a huge number you'll receive a huge number (with lots of digits) back.

**Input:** A string containing a decimal number, up to 254 digits in length. No scientific notation — just plain digits.

**Output:** A string containing a hex number.

**Input:** A decimal string, up to 77 digits long, anywhere from zero to 28948022309329048855892746252171976963317496166410141009864396001978282409983.

**Output:** A string with lots of zeros and ones, representing the number you fed it with.

**Input:** A string with up to 64 hexadecimal digits, from 0 to 3FFFF....

**Output:** A string with lots of zeros and ones, representing the number you fed it with.

**Input:** A string containing a number in octal base, from 0 to 377777.... (85 digits total).

**Output:** A string with lots of zeros and ones, representing the number you fed it with.

**Input:** A string with an octal number, up to 254 digits long.

**Output:** A string with a decimal number.