I am using
i = value.toBigInteger()
i.toString(32).toUpperCase()
to convert a 16 digit 'number' to characters for use in a serial
Is there any way to force this to use the A-Z + 2-7 notation rather than 0-9 + A-V??
I am using
i = value.toBigInteger()
i.toString(32).toUpperCase()
to convert a 16 digit 'number' to characters for use in a serial
Is there any way to force this to use the A-Z + 2-7 notation rather than 0-9 + A-V??
One option would be to re-implement the way BigInteger.toString( radix )
works (with Java 7, it calls java.math.Conversion.bigInteger2String
which can be found here -- and as you can see, would be a large amount of work)
Another would be to use Groovy 1.7.3 and the new tr function to simply replace the chars in your string with those you want instead:
str.tr( '0-9A-V', 'A-Z0-7' )