Here´s hexadecimal compression challenge. It has been generated using online random generator. Challenge is simple - losslessly compress it to the smallest possible size.

Code:
`1000000 0% hexadecimal data.txt`
CompressMaster

2. hex2bin 500000 50% .... it's my first bid, lol

3. Yes :)
I tested it with cdm and paq and it doesn't seem compressible.

Also, I guess that online service uses some crypto-random...
I just tried writing such a generator using VS default PRNG,
```  char b2h[] = "0123456789ABCDEF";
for( i=0; i<N; i++ ) putc( b2h[rand()%16],g );```

and paq8px compressed it to 136k :)

4. ## Thanks:

xinix (13th June 2019)

5. I just tried writing such a generator using VS default PRNG,

I can't believe that it's so predictable. What about LCG

rnd = 29943829*rnd + 1013904223; // https://en.wikipedia.org/wiki/Linear...tial_generator

and modern ones:

1. http://xoshiro.di.unimi.it/
2. http://www.pcg-random.org/

6. “rand() % N“ is known to be bad, see this: https://stackoverflow.com/a/49880109/34065

Basically, if RAND_MAX % N != 0, you get skewed results.

Though in this case, it could indeed be the bad random generator, since N==16 should give good results (and the paq8px result points to a bigger skew).

7. > rnd = 29943829*rnd + 1013904223

In this case, this has a period of 16 :)
But with an extra shift, its good:
```unsigned rnd = 1;
unsigned rng() {
rnd = 29943829*rnd + 1013904223;
return rnd>>24;
}
```
Code:
```1,000,000 1.hex
500,000 1.bin
500,148 1.7z
136,563 1.bin.paq8px179fix3

1,000,000 2.hex
500,000 2.bin
500,148 2.7z
500,290 2.bin.paq8px179fix3```

8. I recall on one machine if had a loop doing "rand()&1" to get random 0 and 1 bits then they alternated 0, 1, 0, 1, ... haha!

[Edit: to be fair to the RNG, they sometimes alternated 1, 0, 1, 0 ... ]

Fortunately MOST machines has long since moved to better random number generators. It's quite shocking if visual studio is still so bad.