Home » Community » Coffee corner » Map implementation
Re: Map implementation [message #51523 is a reply to message #51522] |
Tue, 09 April 2019 17:16 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
You have accidentally succeeded in attack on used hash mechanism - what you see is result of hash collisions. This is sad and something to deal with, however this would be much harder to achieve with String and quite unlikely to happen with real (aka random) data.
Still it is something I am worried about and will fix properly in the next version. For now, try to replace
inline dword FoldHash(dword h)
{
return h - 362437 * SwapEndian32(h);
}
inline int& HashBase::Maph(unsigned _hash) const
{
unsigned h = _hash & ~UNSIGNED_HIBIT;
return map[mask & FoldHash(h)];
}
(In future, I will make '362437' number random prime, which will likely make this kind of attack impossible).
Mirek
EDIT: Forgot the change in Map.h
[Updated on: Wed, 10 April 2019 00:21] Report message to a moderator
|
|
|
|
|
Map implementation
|
|
|
Re: Map implementation
By: mirek on Fri, 22 March 2019 07:18
|
|
|
Re: Map implementation
By: Novo on Wed, 27 March 2019 03:33
|
|
|
Re: Map implementation
|
|
|
Re: Map implementation
By: Novo on Tue, 02 April 2019 17:48
|
|
|
Re: Map implementation
By: Novo on Tue, 02 April 2019 18:39
|
|
|
Re: Map implementation
|
|
|
Re: Map implementation
By: mirek on Mon, 08 April 2019 22:37
|
|
|
Re: Map implementation
|
|
|
Re: Map implementation
By: mirek on Tue, 09 April 2019 17:16
|
|
|
Re: Map implementation
By: mirek on Wed, 10 April 2019 11:07
|
|
|
Re: Map implementation
|
|
|
Re: Map implementation
By: Novo on Wed, 10 April 2019 17:09
|
|
|
Re: Map implementation
By: mirek on Wed, 10 April 2019 17:37
|
|
|
Re: Map implementation
By: Novo on Sat, 13 April 2019 20:58
|
|
|
Re: Map implementation
By: Novo on Sat, 13 April 2019 21:07
|
|
|
Re: Map implementation
By: mirek on Sun, 14 April 2019 08:03
|
|
|
Re: Map implementation
By: Novo on Sun, 14 April 2019 18:55
|
|
|
Re: Map implementation
By: mirek on Sun, 14 April 2019 19:52
|
|
|
Re: Map implementation
By: mirek on Tue, 16 April 2019 12:38
|
|
|
Re: Map implementation
By: Novo on Tue, 16 April 2019 16:38
|
|
|
Re: Map implementation
By: mirek on Tue, 16 April 2019 19:33
|
|
|
Re: Map implementation
By: Novo on Tue, 16 April 2019 22:36
|
|
|
Re: Map implementation
By: Novo on Wed, 17 April 2019 05:40
|
|
|
Re: Map implementation
By: mirek on Wed, 17 April 2019 08:54
|
|
|
Re: Map implementation
By: Novo on Wed, 17 April 2019 16:13
|
|
|
Re: Map implementation
By: mirek on Wed, 17 April 2019 18:39
|
|
|
Re: Map implementation
By: mirek on Fri, 07 June 2019 13:58
|
|
|
Re: Map implementation
By: Novo on Tue, 25 June 2019 15:20
|
|
|
Re: Map implementation
By: mirek on Wed, 26 June 2019 12:07
|
|
|
Re: Map implementation
By: Novo on Mon, 01 July 2019 06:26
|
|
|
Re: Map implementation
By: mirek on Mon, 01 July 2019 17:53
|
|
|
Re: Map implementation
By: Novo on Sat, 13 April 2019 21:25
|
|
|
Re: Map implementation
By: Novo on Wed, 10 April 2019 16:13
|
|
|
Re: Map implementation
By: mirek on Wed, 10 April 2019 17:50
|
|
|
Re: Map implementation
By: Novo on Wed, 10 April 2019 16:48
|
Goto Forum:
Current Time: Fri Mar 29 14:29:26 CET 2024
Total time taken to generate the page: 0.02908 seconds
|