I have some data I need to put into a file, however I want to ensure that the data remains intact. Either from corruption or from a user modifying the file.
Can someone point me in the right direction, of how to add a checksum to a file, read / check the file is correct?
You can use the MD5
hash, that's the best option. Here is how to create a MD5
hash from NSString
, NSData
or a File:
http://iosdevelopertips.com/core-services/create-md5-hash-from-nsstring-nsdata-or-file.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With