Don't make your own password hashing algorithm. It's going to be easily crackable and your users won't appreciate their passwords being stolen when your database is compromised.
Bcrypt and other well-tested hashes do this already:
>>> bcrypt.generate_password_hash('password', 15)
'$2a$15$bzaLXuer1C8dtSckDp3AI.eOoL/nOTsSdpjEMyDMcJ3ZQELdRcLzq'
>>> bcrypt.generate_password_hash('password', 15)
'$2a$15$Ye.cFInKhzo1KvAJGSi6yORV5uEqeW.Z1oAhdfi.163Psz4YPA3CO'
The random salt and the number of rounds are stored within the hash itself, separated by a delimiter, which lets the constant-time password checking function pick the salt out of the resulting hash string.
If for some other reason you need to create secure random strings, use openssl_random_pseudo_bytes()
:
$bytes = openssl_random_pseudo_bytes(64, true);
$hex = bin2hex($bytes);