Click here to Skip to main content
15,907,231 members
Home / Discussions / C#
   

C#

 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George25-Jun-08 2:16
George_George25-Jun-08 2:16 
GeneralRe: md5 can be stored as a 32 bit int Pin
Ennis Ray Lynch, Jr.25-Jun-08 2:47
Ennis Ray Lynch, Jr.25-Jun-08 2:47 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George25-Jun-08 2:50
George_George25-Jun-08 2:50 
GeneralRe: md5 can be stored as a 32 bit int Pin
Ennis Ray Lynch, Jr.25-Jun-08 3:03
Ennis Ray Lynch, Jr.25-Jun-08 3:03 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George25-Jun-08 3:59
George_George25-Jun-08 3:59 
GeneralRe: md5 can be stored as a 32 bit int Pin
Ennis Ray Lynch, Jr.25-Jun-08 4:07
Ennis Ray Lynch, Jr.25-Jun-08 4:07 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George25-Jun-08 4:18
George_George25-Jun-08 4:18 
GeneralRe: md5 can be stored as a 32 bit int Pin
Guffa25-Jun-08 6:59
Guffa25-Jun-08 6:59 
George_George wrote:
2. We can further using the hash value as the unique identifier for "abc", e.g. check whether such hash value exists is the same as checking "abc" existence;


No, that is not correct. Checking the hash code is not the same as checking the actual value.

It's only possible to get a unique 32-bit hash code if you exclusively have very short strings, i.e. not more than four characters. If character codes outside the regular ASCII character set is used, you can't have longer strings than two characters. If you have longer strings than that, it's not possible to guarantee a unique hash code.

George_George wrote:
3. Upgrade to .Net 3.5, and calculate new hash value for "abc", since the new value does not match the old hash value, the system will believe "abc" does not exist and some other value exists.


That's definitely an issue (although not with .NET 3.5 as it still uses framework 2.0). The hash code provided by the GetHashCode method is not intended for persistent storage.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: md5 can be stored as a 32 bit int Pin
George_George29-Jun-08 17:47
George_George29-Jun-08 17:47 
GeneralRe: md5 can be stored as a 32 bit int Pin
Guffa30-Jun-08 5:17
Guffa30-Jun-08 5:17 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George30-Jun-08 15:31
George_George30-Jun-08 15:31 
GeneralRe: md5 can be stored as a 32 bit int Pin
Guffa1-Jul-08 10:26
Guffa1-Jul-08 10:26 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George2-Jul-08 1:39
George_George2-Jul-08 1:39 
GeneralRe: md5 can be stored as a 32 bit int Pin
Guffa25-Jun-08 7:08
Guffa25-Jun-08 7:08 
GeneralRe: md5 can be stored as a 32 bit int Pin
George_George29-Jun-08 17:49
George_George29-Jun-08 17:49 
AnswerRe: hash function Pin
Guffa24-Jun-08 5:19
Guffa24-Jun-08 5:19 
GeneralYes Pin
Ennis Ray Lynch, Jr.24-Jun-08 6:02
Ennis Ray Lynch, Jr.24-Jun-08 6:02 
GeneralRe: Yes Pin
Guffa24-Jun-08 8:06
Guffa24-Jun-08 8:06 
GeneralRe: Yes Pin
George_George24-Jun-08 22:06
George_George24-Jun-08 22:06 
GeneralRe: Yes Pin
Guffa25-Jun-08 2:35
Guffa25-Jun-08 2:35 
GeneralRe: Yes Pin
George_George25-Jun-08 2:48
George_George25-Jun-08 2:48 
GeneralRe: Yes Pin
George_George24-Jun-08 22:05
George_George24-Jun-08 22:05 
GeneralRe: Yes Pin
Guffa25-Jun-08 7:14
Guffa25-Jun-08 7:14 
GeneralRe: Yes Pin
George_George29-Jun-08 17:51
George_George29-Jun-08 17:51 
GeneralRe: Yes Pin
Guffa30-Jun-08 4:56
Guffa30-Jun-08 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.