Replaced mt_rand() for openssl_random_pseudo_bytes() for better security