Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a34332

Browse files
committed
[#5472] Minor tweak and adding code example
1 parentc520e77 commit6a34332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎components/security/secure_tools.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ to work correctly. Just pass a file name to enable it::
5050
use Symfony\Component\Security\Core\Util\SecureRandom;
5151

5252
$generator = new SecureRandom('/some/path/to/store/the/seed.txt');
53+
5354
$random = $generator->nextBytes(10);
55+
$hashedRandom = md5($random); // see tip below
5456

5557
..note::
5658

@@ -60,7 +62,7 @@ to work correctly. Just pass a file name to enable it::
6062
..tip::
6163

6264
The ``nextBytes()`` method returns a binary string which may contain the
63-
``\0`` character. This can causetroubles inlots of common scenarios, such
65+
``\0`` character. This can causetrouble inseveral common scenarios, such
6466
as storing this value in a database or including it as part of the URL. The
6567
solution is to hash the value returned by ``nextBytes()`` (to do that, you
6668
can use a simple ``md5()`` PHP function).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp