Math.random() corner case

the original multiplication will never reach 65535 resp. 255, because Math.random() generates a number between 0 inclusive and 1 exclusive.
By the way, I think some & 0xff are redundant, but with them the code is better comparable with David G. Carta's code.