I would like to create a a random number with random_bytes(). Can I just store the random_bytes output in the database field?
Is that for instance more secure?
And, regarding to sending it by email, what is the advantage above sending a code like uniqid() or md5($_POST['var'] + microtime() ?
I see the screen output is a bit uncommon (with ? in a diamond ) does that have to do with the encryption? And is that the reason why reason bin2hex is used to decrypt?
this is the code I would like to use:
<html>
<center>
<br><br><br>
the output of the function random_bytes is:
<br><br>
<?php
$num = random_bytes(15);
echo '<br><br>' . $num ;
echo '<br><br> var dump of random_bytes with bin2hex: ' ;
echo bin2hex($num);
?>
</center></html>