Why random_bytes function displays krakozyabliki?

0 like 0 dislike
3 views
For example, 5ae1851b211b6381537814.png
File test.php in utf-8, the Code:
<?echo random_bytes(32);</code>
by | 3 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 12, 2019 by UnknownErrror
110,608 questions
257,186 answers
0 comments
33,949 users