Wie sollte man bei Hash-Funktionen (Hash-Algorithmen) mit Hash-Kollisionen (# collision) umgehen, wie handhabbar/ lösbar?
“gleichzeitig” selbe Antwort bzw. selber Wert, d.h. die zeitliche Komponente verfeinern (“der Erste malt zu erst”) oder einen anderen Faktor hinzufügen (z.B.: ; Koordinaten; Lokalität) ?
Without more detailed information, I can only look and orak my “glass ball”.
What do you want?
When it comes to hashcollisions you simply chose a “shmal” agorithmus
Powershell:
MD5 delivers a 128-bit “width” hash value so that 340282366920938463463374607431768211456 possibilities can be distinguished. This number is enormous for itself. Notwithstanding the quite large number, a collision is possible under certain conditions
At SHA512, a collision would be more unlikely than a black hole under your computer chair
The real probability of a collision is 1 to 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096
For SHA256 .. 512 even extremely short strings are no problem https://stackoverflow.com/a/7624669 Collisions are not known.
..in view of this, you do not need a craft, but simply a sufficient wide hash.
Gaz by the way is simultaneousness an illusion.
If you want to build a login, it is up to you to collect sufficiently distinguishable data for creating a hash.
You may need to check when registering whether there is a similar user and reject his login name. This is the reason why an email address is usually used. The mailhost has already done this work. there are every email address just once. Combined with the “good” password string and a secure hash SHA256 … SHA512 there can only be a clear assignment!
PS: if you can hate long strings part and parts individually You show every paranoia the midfinge already at two 512s the whispering sureal: CAS number
Never heard of exception handling?
In addition, collisions with modern algorithms are relatively rare.
In your place, I would also use prefabricated libraries.
That depends on the language.
Unfortunately, you also describe your problem very inaccurately.
But “factors” or conditions that change something, you simply do with a “if/else if” function.
The question is not to be answered, since it depends on the application and what problems a collision entails.