in reply to Re: Add 1 to an arbitrary-length binary string
in thread Add 1 to an arbitrary-length binary string
So maybe if you can figure out how to translate "a\xff"+1 == "b" to Perl.
Well ... this is precisely what Math::GMPz's Rmpz_import() and Rmpz_export() do.
In the second of the 2 scripts I provided earlier, the string "aa" gets incremented to "ab", and the string "a\xff" gets incremented to "b".
This suggests that the underlying gmp functions (mpz_import and mpz_export), wrapped by Rmpz_import/Rmpz_export, might well be providing the desired behaviour.
Cheers,
Rob