knadh / dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.
https://www.dns.toys
MIT License
2.5k stars 137 forks source link

Support number conversion between bases #11

Closed varunlakkur closed 2 years ago

varunlakkur commented 2 years ago

I often use calculator to convert from hex to decimal, decimal to binary and such. It would be useful to add support for this conversion in dns.toys. Something like this:

Example 1:

dig 11234dec-hex.base @dns.toys

1234HEX-DEC.        1   IN  TXT "1234 HEX = 4660 DEC"

Example 2:

dig 1234dec-bin.base @dns.toys

1234DEC-BIN.        1   IN  TXT "1234 DEC = 10011010010 BIN"
varunlakkur commented 2 years ago

I have some changes in a forked repo (https://github.com/knadh/dns.toys/compare/master...varunlakkur:master)

If you are okay taking the changes, I will submit a PR.

knadh commented 2 years ago

That's very cool @varunlakkur. Please do send a PR.

knadh commented 2 years ago

Merged in https://github.com/knadh/dns.toys/pull/13