Re: QByteArray sum
There is no native 8-bit integer type. Qt provides quint8, which is guaranteed to be an 8-bit unsigned value on any platform, but it's effectively an unsigned char type. So, use quint8 or an unsigned char if you *must* compute the sum using a single byte.
In my opinion, using an integer type for the sum and computing the remainder using sum % 256 is more straight forward in my opinion.
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
Bookmarks