Last active
March 24, 2016 16:34
-
-
Save priore/2dbe6672666972ff76a1 to your computer and use it in GitHub Desktop.
CRC32 from generic NSObject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <zlib.h> | |
| - (NSUInteger)crc32 | |
| { | |
| // the object requires NSObject-Coding https://github.com/priore/NSObject-Coding | |
| NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self]; | |
| return crc32(0, data.bytes, data.length); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment