Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:38
Show Gist options
  • Save tylertreat/19c422ab4848e7beb60b to your computer and use it in GitHub Desktop.
Save tylertreat/19c422ab4848e7beb60b to your computer and use it in GitHub Desktop.
public int computeModelHash(Class<?> c, Serializable pk) {
final int PRIME = 31;
int hash = 7;
hash *= PRIME + c.hashCode();
hash *= PRIME + pk.hashCode();
return hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment