in reply to Re^2: Add 1 to an arbitrary-length binary string
in thread Add 1 to an arbitrary-length binary string

That would be true if all strings were hex numbers, but "/Some/Arbitrarily/long/string" (see Re^2: Add 1 to an arbitrary-length binary string) doesn't look like a hex number to me...

Shouldn't  "61FF" + 1 = "61FG" ?

If a set of test cases were provided, that could clarify the matter.

Replies are listed 'Best First'.
Re^4: Add 1 to an arbitrary-length binary string
by syphilis (Archbishop) on Nov 16, 2023 at 06:53 UTC
    Shouldn't "61FF" + 1 = "61FG" ?

    In short, the string "\x61\xFF" gets incremented to "\x62\x00" ... which seems a reasonable way to do it.
    Perhaps this is already clear (either implicitly or explicitly) from what others have provided to this thread.

    Cheers,
    Rob
Re^4: Add 1 to an arbitrary-length binary string
by ikegami (Patriarch) on Nov 16, 2023 at 05:36 UTC

    I'm not talking about the string produced by "61FF" but the string produced by "a\xFF", which is a weird and apparently confusing way of referring to the hex number 61FF.