Improve hasher to always use 31bit ints