echo random_bytes($length);
$str=random_bytes(7); echo bin2hex($str);
d3fd88d7838c2a
Post your comments , suggestion , error , requirements etc here