From dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 10 Aug 2012 19:05:05 +0200 Subject: ICE-4702 - Poor hash algorithm --- cpp/src/Ice/Reference.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cpp/src/Ice/Reference.cpp') diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 3ec8385c214..0b8a6eaff7b 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -483,12 +483,20 @@ IceInternal::Reference::Reference(const Reference& r) : int IceInternal::Reference::hashInit() const { - Int h = static_cast(_mode); + Int h = 5381; + hashAdd(h, static_cast(_mode)); + hashAdd(h, _secure); hashAdd(h, _identity.name); hashAdd(h, _identity.category); hashAdd(h, _context->getValue()); hashAdd(h, _facet); - hashAdd(h, _secure); + hashAdd(h, _overrideCompress); + if(_overrideCompress) + { + hashAdd(h, _compress); + } + hashAdd(h, _encoding.major); + hashAdd(h, _encoding.minor); return h; } -- cgit v1.2.3