Reputation: 1927
I have heard, but I now cannot find evidence that a checksum can vary from machine to machine where the file is the same. Is that true? We are considering relying on a checksum in our application that will be calculated on many different machines, will this be reliable?
Upvotes: 0
Views: 525
Reputation: 44804
It depends on the algorithm. If you are using a multibyte (>8 bit) checksum that uses integer (two's complement) math, then you will get different results depending on the endianness of the machine.
This is why a lot of network checksum algorithms use one's complement math instead of two's complement.
If both machines are the same OS and archtecture, you should be OK (unless your algorithm does something really weird).
Upvotes: 1
Reputation: 8487
Yes, as long as you make sure you are using the same checksum algorithm, it will be fine.
Upvotes: 0