Well you could just nomalize and use: hash = (double)Num/Max * 23;
CODE
<mathematica code>
hash[x_] := Floor[(x/1000)*23]
hash[{774, 843, 889, 912, 958, 16, 85, 200, 315, 407}]
-> {17, 19, 20, 20, 22, 0, 1, 4, 7, 9}
which only has 20 twice.
and
hash[x_] := Floor[(x/1024)*23]
hash[{774, 843, 889, 912, 958, 16, 85, 200, 315, 407}]
-> {17, 18, 19, 20, 21, 0, 1, 4, 7, 9}
each item has a unique hash.
When i use your version
hash[x_]:=Mod[Floor[x/4],23]
hash[{774, 843, 889, 912, 958, 16, 85, 200, 315, 407}]
-> {9, 3, 15, 21, 9, 4, 21, 4, 9, 9}
which has a problem with 9's and 21's... however
hash[x_]:=Mod[Floor[x/45],23]
hash[{774, 843, 889, 912, 958, 16, 85, 200, 315, 407}]
-> {17, 18, 19, 20, 21, 0, 1, 4, 7, 9}
(coincidance... I think not!!!)
</mathematica code>
Well I will leave you to figure out what way to use and why.