ASCII to decimal conversions

Hi,

I need to convert DNS ascii representations (in query) of an IP address to dotted quad decimal format.

For example, the number 10 is represented in the packet as Hex 3130. (31 ASCII = 1 decimal, 30 ASCII=0 decimal).

Anyone know an easy, efficient way to convert this to 10 decimal?? Thanks!

This works:

binary scan \x31\x30\x31\x30\x31\x30\x31\x30 a2a2a2a2 A B C D
set address "$A.$B.$C.$D" 
log local0. "catch $address => [catch {IP::addr $address mask 255.255.255.255} ]"