Skip to content

Instantly share code, notes, and snippets.

@steipete
Last active October 24, 2017 12:14
Embed
What would you like to do?
Create a hash from a CGRect
NSUInteger PSPDFHashFromCGRect(CGRect rect) {
return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment