string length +1 modulo 4 is the same as the number of significant characters in the last byte. I.e. that is an implementation detail I left out on purpose.
If you mean comparision for equality, then putting the count into the first byte will be a lot faster for 75% of different-length strings and not much slower for same-length strings. Only if you want to know the first position at which they differ is the last byte better.
The advantage I see for last byte is that you can more easily append or cut from the end of the compressed string
In reply to Re^3: Unpack Fail to Decompress String?
by jethro
in thread Unpack Fail to Decompress String?
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |