I am doing a calculation which includes an entire byte array, simply adding all the bytes together into a 32-bit int.
Trouble is, its treating it as signed. So some additions are actually subtractions.
I dont want this happening, I want to add all absolute values of each byte to come out with an entirely positive 32-bit int. (This is a checksum algo for custom hardware)
any ideas?
Trouble is, its treating it as signed. So some additions are actually subtractions.
I dont want this happening, I want to add all absolute values of each byte to come out with an entirely positive 32-bit int. (This is a checksum algo for custom hardware)
any ideas?