From af6968b5da410f2888db2058f7e7fcae727b4f9a Mon Sep 17 00:00:00 2001 From: Roman Marynchak Date: Wed, 24 Nov 2010 23:13:01 +0200 Subject: [PATCH] better MIX function for SXHASH Add more "randomness" to MIX function by shifting the input values combination XY in both directions and counting X and Y values with the different coefficients during the mixing process. --- src/code/target-sxhash.lisp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/code/target-sxhash.lisp b/src/code/target-sxhash.lisp index 953160b..d8d7adc 100644 --- a/src/code/target-sxhash.lisp +++ b/src/code/target-sxhash.lisp @@ -70,7 +70,8 @@ (let* ((xy (+ (* x 3) y))) (logand most-positive-fixnum (logxor 441516657 - xy + (ash (- xy (* y 13) 8738747) 9) + (ash (+ xy (* x 23) 7882763) -9) (ash xy -5))))) ;;;; hashing strings -- 1.6.0.4