I want to generate cryptographically secure unique uuids using php.
uniqid() provides unique but not secure ids and openssl_random_pseudo_bytes() provides secure but not unique ids. Is the combination of the two(following code) a proper approach or is there a better solution?
uniqid(bin2hex(openssl_random_pseudo_bytes(10)), true);
Why not hashing the output of openssl_random_pseudo_bytes? You could also concat a timestamp and hash it afterwards
Using md5 just as an example. You can use any hash algorithm.