summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-04-28 22:49:31 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-04-28 22:49:31 (GMT)
commitff0db1dfb9941fac2087191cc32446eb39ab16e1 (patch)
tree05a05b3ac2c8be38506587bfc435efdd91db2c6c
parentb4e85853c644b05762687d8bec2396a8b9122bf5 (diff)
downloadlz4-ff0db1dfb9941fac2087191cc32446eb39ab16e1.zip
lz4-ff0db1dfb9941fac2087191cc32446eb39ab16e1.tar.gz
lz4-ff0db1dfb9941fac2087191cc32446eb39ab16e1.tar.bz2
modified : rand generator
-rw-r--r--programs/fuzzer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index 55b3bb5..9b17209 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -105,10 +105,15 @@ static int FUZ_GetMilliSpan( int nTimeStart )
}
+# define FUZ_rotl32(x,r) ((x << r) | (x >> (32 - r)))
unsigned int FUZ_rand(unsigned int* src)
{
- *src = XXH32(&src, sizeof(src), 0);
- return *src;
+ U32 rand32 = *src;
+ rand32 *= PRIME1;
+ rand32 += PRIME2;
+ rand32 = FUZ_rotl32(rand32, 13);
+ *src = rand32;
+ return rand32;
}