Small improvement for genHashcode