Reminds me a bit of dc:
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
You'll note on that last line a |dc` as all of that stuff after the `echo` gets packed into something for dc to run.bc -l supports arbitrary-precision arithmetic, IIRC.
I am not sure there is a limit but 99 works ...