Click here to Skip to main content
15,886,038 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
Hi,

I need to get a guid of 64 bits. I know that guid generation using COM will give me 128 bits. It might be a stupid question since I would like to think MS would want to keep it secret but no harm trying : Does anyone know how does it work ? Does it use MD5 ?

I seem to have a hazy memory of someone mentioning that it is a standard practice to use first 64 bits of the MD5 hash.. is that true ?

I did come-across some custom hashing mechanisms like murmurhash for 64 bits but due to licensing, I would want to avoid.. are there any other ideas ?

I can think of making up my own "almost unique" guids using RNGs and seeding it with time-stamp.. but obviously its too indeterminate to know the error probability and hence would need a lot of convincing for myself before using it.

Thanks,
Shishir
Posted

I didn't read it, but this might answer your question:

http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt[^]
 
Share this answer
 
Comments
ThatsAlok 14-Jul-11 2:35am    
nice link, enrolled same in my blog :-)
Just to add to the above answer, we can use only the first few bytes of the UUID generator.. The above link shows that MD5 is used.. and hashing algorithms are designed such that if you use a part of the output, it is equivalent to using low-byte generator.. for example, 128 bits output of the SHA-512 Hash algorithm should be cryptographically as strong as using a 128 bit MD5 algorithm..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900