'Are hashes Platform independent (PC/Android/Iphone/etc.) [duplicate]

As the question says, if I'm downloading let's say a zip file on different hardware & devices, mobile/windows/mac. Can I be certain that for example an MD5 or SHA hash will be identical across all platforms. My worry is file system/differences between platforms when unzipping this folder.

Ideally I'm hashing through all files in alphabetical order & combining them, and then checking that against a database hash string to ensure contents are never changed whenever the application runs.



Solution 1:[1]

Yes for md5 and sha. Implementations of common public used hashfunctions produce the expected output for all these systems.

I can additionally say that I have had this in working correctly in production with the combination of iphone + windows.

This also has been asked and answered already so id say is a duplicate: Is a hash function (e.g. SHA) platform independent?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 t0b4cc0