randomness and compression for javascript