helper/hashcode for generating hashcodes