|
Great analysis, Guffa!
"(As strings are unicode, in reality each character can have a lot more than 96 different values, which of course greatly increases the number of possible combinations.)" -- do you mean unicode strings are more prone to have the same hash value (i.e. conflicting) for the same input?
regards,
George
|
|
|
|
|
George_George wrote: do you mean unicode strings are more prone to have the same hash value (i.e. conflicting) for the same input?
In .NET all strings are unicode.
No, I mean that if you consider the full unicode character set, there are a lot more possible combinations of characters in a ten character string. That means that there are more combinations that share the same hash code, but that doesn't mean that any two strings have a higher chance of sharing the same hash code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa!
I agree. Cool!
regards,
George
|
|
|
|
|
If the distribution is good, you can just use any 32 bits from the 128 bits.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa,
Two more questions,
1.
"distribution is good" -- distribution of string to hash or distribution of MD5 result?
2.
"distribution is good" -- how do you define good generally?
regards,
George
|
|
|
|
|
Is there something wrong with the GetHashCode method in the string class?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
It's not enterprisey.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: It's not enterprisey.
Oh. I thought that it perhaps was too NIH.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
NIH is short for?
regards,
George
|
|
|
|
|
Not Invented Here
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ok, Guffa!
Any existing technologies is fine. Any solution you could provide to me for my original question?
regards,
George
|
|
|
|
|
Can you speak in some other words? My English is not good, sorry. "enterprisey" you mean?
regards,
George
|
|
|
|
|
Genrally that means overly complicated.
As there is a built-in method in the string class that does what you ask for, you should obviously look at that before you look for anything "better".
As it turns out, the built-in method doesn't fulfill all your requirements, but it sure fulfills all the requirements that you mentioned in your original post.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa,
The "built-in method" -- you mean GetHashCode?
regards,
George
|
|
|
|
|
Yes.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Cool, Guffa!
regards,
George
|
|
|
|
|
Probably not, but George like to know his limits
|
|
|
|
|
Yeah its kinda crap
Well... its very very fast, uses some sort of parity method. You get collisions all the time though in fairly general usage.
|
|
|
|
|
Hi Mark,
Sorry I lost your context. Do you mean GetHashCode method?
regards,
George
|
|
|
|
|
Yep. GetHashCode is designed to be very fast. Tradeoff is that its also weak, poor dispersion, and not guaranteed to give you the same value over different versions of the framework.
It's basically for sorting keys into buckets for hashtables and that sort of thing.
|
|
|
|
|
Hi Mark!
1.
"not guaranteed to give you the same value over different versions of the framework" -- I think it is the main issue. Suppose we have hash value data generated by .Net 2.0 and then upgrade to 3.5, we need to upgrade both code and data. Correct?
2.
"not guaranteed to give you the same value over different versions of the framework." -- are there any official documents? I can not find any. It is appreciated if you could refer some.
regards,
George
|
|
|
|
|
Hi Guffa!
My concerns,
1. GetHashCode is random enough?
2. GetHashCode is not language independent and C# version independent? I want to find some standard way, which is platform/language independent, like CRC32, MD5 or something.
Any comments?
regards,
George
|
|
|
|
|
When maximize Form - i want to save the place and make them bigger
( proportionally ) - how can i do it in most easy way ??
|
|
|
|
|
Set the anchor properties of your controls to size as you want
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I set the anchor properties already - but first .. .its not working and the controls have any effect - and second ... when i comeback to check the anchor properties after running my application - then its come back the the value that was before i change it and i don't know why.
|
|
|
|