note 118082 added to function.random-bytes
| From: | niklongstone at gmail dot com | Date: | Wed, 30 Sep 2015 20:12:03 +0000 |
| Subject: | note 118082 added to function.random-bytes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203883@lists.php.net to get a copy of this message | ||
In order to handling better the result, could be useful to combine random_bytes with the unpack
function, because gives more flexibility.
Example:
$bytes = random_bytes(10);
$value = unpack('H*', $bytes);
var_dump($value);
Output:
array(1) { [1]=> string(20) "5f655db3ae43c256937b" }
----
Server IP: 72.52.91.14
Probable Submitter: 94.197.120.196
----
Manual Page -- http://php.net/manual/en/function.random-bytes.php
Edit -- https://master.php.net/note/edit/118082
Del: integrated -- https://master.php.net/note/delete/118082/integrated
Del: useless -- https://master.php.net/note/delete/118082/useless
Del: bad code -- https://master.php.net/note/delete/118082/bad+code
Del: spam -- https://master.php.net/note/delete/118082/spam
Del: non-english -- https://master.php.net/note/delete/118082/non-english
Del: in docs -- https://master.php.net/note/delete/118082/in+docs
Del: other reasons-- https://master.php.net/note/delete/118082
Reject -- https://master.php.net/note/reject/118082
Search -- https://master.php.net/manage/user-notes.php