Use randomNumber instead of rand for better randomness. Use randomElement for picking elements from the allowed digits to make it possible for both digits of a MAC address block to be the same. Fixed for test failing on PHP 5.3.