Hi freaks,

As anytime I have a question. This time about Hash functionallity.

Basically I want to calculate a hash value with 2 Bytes out of a 10 Byte value. Basically that would mean I will have a lot of collisions in my hash table if I would have all possible 10 Byte.

But I will only have 1000 of the 10 Byte values to hash. But how can I calculate how big the chance is that I will have 1000 same hash values or how big is the chance that I will have a lot less collisions? This cracks my brain.

Than there is the next question: I'm thinking about using the DJB Hash function: http://www.cse.yorku.ca/~oz/hash...

But this function is optimized to give back a 32 Bit Hash, while no one can explain why the 33 is working that good). As mentioned I would use a 16 Bit Hash. That means a cast to 16 Bit should do the job (or maybe better a modulo with a big prime (< 65535)), but will this break the well working algorithm?

Regards,

Baldrian

*brain is smoking*