Why random_bytes function displays krakozyabliki?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
8 views
For example, 5ae1851b211b6381537814.png
File test.php in utf-8, the Code:
<?echo random_bytes(32);</code>
by | 8 views

3 Answers

0 like 0 dislike
I think this is due to the fact that the function generates random bytes, not letters.
by
0 like 0 dislike
Because it displays bytes instead of a string randomly.
by
0 like 0 dislike
Use over function php.net: bin2hex, for example:
$bytes = random_bytes(12); var_dump(bin2hex($bytes));
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked Apr 27, 2019 by Centrovoy
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Apr 13, 2019 by UnknownErrror
110,608 questions
257,186 answers
0 comments
36,596 users