https://github.com/pharo-project/pharo/pull/487
2017-11-16 23:32 GMT+01:00 Nicolas Cellier < nicolas.cellier.aka.n...@gmail.com>: > It's not documented because hashing is complex... > The goal is to shuffle the receiver bits and distribute them over the > available 28bits used for hash codes. > why and how it does so is a tough subject, Andres Valloud wrote a whole > book on it ;) > > The basic operation which is emulated is relatively simple, but > implementation is overly complex, because it tries to avoid creating > LargeIntegers in 32bits VM > > *16384 is <=> bitShift: 14 > bitAnd 16383 is <=> isolating lowest 14 bits... > > While at it, one should also rewrite the method contents in order to use > the new primitive available > and profit by more efficient 64bit version for 64bit VM... > > Fortunately, one can still pick the methods from Squeak :) > then forget the original authors because it really does not matter, does > it? > > > 2017-11-16 22:25 GMT+01:00 Stephane Ducasse <stepharo.s...@gmail.com>: > >> Hi guys >> >> I would love to have a better method comment for >> >> >> hashMultiply >> | low | >> low := self bitAnd: 16383. >> ^(16r260D * low + ((16r260D * (self bitShift: -14) + (16r0065 * >> low) bitAnd: 16383) * 16384)) >> bitAnd: 16r0FFFFFFF >> >> >> Some love? >> >> Stef >> >> >