fix hashCode generation in JS