hashCode utility function

Useful to compute hash code on objects containing multiple fields