Skip to content

Instantly share code, notes, and snippets.

@eggie5
Created July 29, 2012 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggie5/3196548 to your computer and use it in GitHub Desktop.
Save eggie5/3196548 to your computer and use it in GitHub Desktop.
def hash
prime = 31;
result = 1;
result = prime * result + ((id == nil) ? 0 : id.hash);
result = prime * result + ((timestamp == nil) ? 0 : timestamp.to_s.hash);
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment