http://www.perlmonks.org?node_id=913765


in reply to Re^2: Binary value of string
in thread Binary value of string

If you use "W" with unpack, then it will behave the same as ord.

Is there any point in checksumming using unicode ordinals?

Sum-the-bytes checksums are pretty useless -- you can perform any transpositions, shuffle or reverse the entire string and detect nothing -- that's why CRC's and Adler etc. were invented.

The only (scant) merit of sum-the-bytes is that it is very fast. What would be achieved by slowing that to a crawl by forcing it to pick its way through the technical abortion that is multi-byte character encodings? You certainly aren't going to gain any greater guarantee of integrity.

My gut feel is that as the are so many different "unicode standard" encodings out there in the wild, the chances of getting false positives from undetected transmission errors using sum-the-ordinals values, is far higher then using sum-the-bytes values.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.