I want to hash a char array in to an int or a long. The resulting value has to adhere to a given precision value. The function I\'ve been using is given below:
Every hash will have collisions. Period. That's called a Birthday Problem.
You may want to check cryptographic has functions like MD5 (relatively fast and you don't care that it's insecure) but it also will have collisions.