con php puoi usare:

$random = md5(uniqid(microtime(), true));
echo $random;