Tuesday, 10 September 2013

Can i use MD5(String)+SHA1(String) for uniqueid? (ASCII Only)

Can i use MD5(String)+SHA1(String) for uniqueid? (ASCII Only)

i tried this piece of code
For i=1 to 1000000
mystring.s=Str(i)+"'2013-"+mm+"-"+dd+"','"+valoare+"','"+curs+"','"+total+"','"+Str(cont)+"','"+simbolcont+"','Denumire"+Str(i)+"','"+valuta.s+"','"+RSet(Str(i),40,"0")+"','"+total.s+"'"
id.s=UCase(MD5Fingerprint(@mystring.s,StringByteLength(mystring))+SHA1Fingerprint(@mystring,StringByteLength(mystring)))
Next ithe code above is in Purebasic, but i am more intrested in the
principle of using this for uniqueid i can say that in 1,000,000 generated
strings i did not found any collisions
MD5(String)+SHA1(String) resulting a 72 characters string for uniqueid?
Keep in mind that String is the same in both functions and variyng length
300-350 chars
or the simple question
if a SHA1 collide does a MD5 of same string collide too? or viceversa? i'm
not a math genius, but i guess the colliding factor is low..
i can not use uniqueid based on timestamp here.
Thank you for your time.

No comments:

Post a Comment