updated perturbed hash code to use primitives