tags:

views:

362

answers:

1

We're working with a proprietary database and have a table whose semantic compound key consists of a 128-bit GUID and a 64-bit timestamp. "Semantic compound key" in a sense that multiple records with the same GUID may occur in the table, as well as multiple records with the same timestamp; however the pair (GUID, timestamp) is unique. As an enhancement to better support the hashing mechanism, we could force the timestamp to be completely unique, e.g. by incrementing it by a millisecond.

The proprietary database is rather minimalistic and has a 128-bit hash key which we would like to use for fast access. Thus we need to hash the GUID and the timestamp into a 128-bit field, i.e. into another GUID.

Can you propose a hash function which may serve this purpose the best?

+2  A: 

How about MD5? It has the right length and good distribution characteristics. Is computationally more intensive than an XOR of the two fields you have, true.

Remus Rusanu