Is there any way to determine the largest supported value?

more precise would be the need to find the lowest non-supported value. this is related to an issue i'm dealing with trying to condense hex output from hashes like sha1 to fewer digits, but there was a limit to how many digits i could convert to base-36 without being able to convert from base-36 back to the original number, and it's not easy to tell whether mIRC was able to create the correct base-36 value and the error happened converting back to the original, or whether both values are wrong. i use the following alias to check numbers:

basetest {
if ((!$2) || ($1 !isnum 1-36)) { echo -s syntax: /basetest BASE(1-36) value | halt }
var %temp $2
echo -s len $len($2) $2 from base $1 to 36 and back
var %temp $base($2,$1,36)
echo -s len $len(%temp) %temp as base 36
echo -s final $base(%temp,36,$1) back to base $1
}

The smallest hex value i've found to return an error is:

//basetest 16 2 $+ $str(0,12) $+ 1

but the next higher number does not return an error, and there's a range of values where some return correct and some do not.

----

On a related note, i'm not sure if this is a bug or not, but $base isn't behaving as i expected when feeding invalid values to it. It seems to always allow all base-36 values from 0-9 and a-z, and the base only determines the multiplier to apply to each 'place' value.

//echo -a $base(a0,10,10) returns 100 instead of error/zero

//echo -a $base(z0,10,10) returns 350