flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
cod3b453
I don't know the algorithm but I think the values 16777619 and 2166136261 are prime so any multiple in the field h (2^32) will not collide. This is similar to the linear congruence method used for PRNG functions, where you choose "good" (usually prime) values. When mixing the key stream into the calculation, XOR is a good choice because, unlike addition or multiplication, values such as 0,1,2^n (
![]() Given that h is 2^32, there will certainly be a collision after 2^32 different inputs; there is also a fair chance that if you tried 2^32 different keys you'd find one or more collisions. Hope that helps. |
|||
![]() |
|
Tomasz Grysztar
idle wrote: Fasm uses the algo too & fasm limits symbols length to 2xx chars: is it proved no collisions appear ever. |
|||
![]() |
|
idle
Code: aaigb: arsga: compiles |
|||
![]() |
|
Goplat
fasm has a linked list for each used hash value, so you're allowed to have multiple labels with the same hash value, it'll just be slow if there's a whole lot of them. Unless you're making collisions on purpose it won't be a problem.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.