In our previous episode, Ryan Joseph said: > > unsigned int hash(unsigned int x) { > x = ((x >> 16) ^ x) * 0x45d9f3b; > x = ((x >> 16) ^ x) * 0x45d9f3b; > x = (x >> 16) ^ x; > return x; > } > > function Hash (x: PtrUInt): PtrUInt; > begin > x := (Power((x shr 16), x)) * $45d9f3b; > x := (Power((x shr 16), x)) * $45d9f3b; > x := Power((x shr 16), x); > result := x; > end;
- In C operator crypto lingo, ^ is xor, not exponentiation. - the lower 3,4 bits of heap pointer are usually not used, - for 64-bit you probably have to chage this and have more terms also with - shr 32 and 48 _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal