Skip to content

Instantly share code, notes, and snippets.

@priore
Last active March 24, 2016 16:34
Show Gist options
  • Select an option

  • Save priore/2dbe6672666972ff76a1 to your computer and use it in GitHub Desktop.

Select an option

Save priore/2dbe6672666972ff76a1 to your computer and use it in GitHub Desktop.
CRC32 from generic NSObject
#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