We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentc520e77 commit6a34332Copy full SHA for 6a34332
components/security/secure_tools.rst
@@ -50,7 +50,9 @@ to work correctly. Just pass a file name to enable it::
50
use Symfony\Component\Security\Core\Util\SecureRandom;
51
52
$generator = new SecureRandom('/some/path/to/store/the/seed.txt');
53
+
54
$random = $generator->nextBytes(10);
55
+ $hashedRandom = md5($random); // see tip below
56
57
..note::
58
@@ -60,7 +62,7 @@ to work correctly. Just pass a file name to enable it::
60
62
..tip::
61
63
64
The ``nextBytes()`` method returns a binary string which may contain the
- ``\0`` character. This can causetroubles inlots of common scenarios, such
65
+ ``\0`` character. This can causetrouble inseveral common scenarios, such
66
as storing this value in a database or including it as part of the URL. The
67
solution is to hash the value returned by ``nextBytes()`` (to do that, you
68
can use a simple ``md5()`` PHP function).