consider string size in hex2dec transformation

Reported by gergelypeli on GitHub
Closes #296