Improve the OOP ABI
deadalnix
deadalnix at gmail.com
Wed Jan 24 01:18:18 UTC 2024
On Tuesday, 23 January 2024 at 22:15:11 UTC, Siarhei Siamashka
wrote:
> On Tuesday, 23 January 2024 at 21:37:42 UTC, Walter Bright
> wrote:
>> On 1/23/2024 3:49 AM, Andrea Fontana wrote:
>>> So probably you like xxhash128
>>>
>>> https://xxhash.com/
>>
>> Thanks! I do, it has a 64 bit version, does anyone know what
>> the collision rate is?
>
> If you really need a 64-bit version, then you can simply take
> the first 64 bits of MD5. Assuming no defects in a 64-bit hash
> implementation, the collision probability is `1.0 / 2^^64` for
> a pair of hashed strings. And it becomes a
> https://en.wikipedia.org/wiki/Birthday_problem if the number of
> hashed strings is larger. There's no magic algorithmic sauce
> that can make a small hash collision resistant. A quote from
> the Wikipedia article:
>
While it is not possible to do better than this, it is certainly
possible - and in fact way easier than you'd expect - to do worse.
I see no reason to move away from md5 here. It works, its speed
is nowhere close to the bottleneck, and its pre-image resistance
is of no concern for this use case.
This thread has gone in the typical bullshit D goes into, arguing
about the intricacies of some details that do not matter at all
for the value delivered in the end.
More information about the Digitalmars-d
mailing list