{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/49053799","id":49053799,"diff_hunk":"@@ -9,39 +9,28 @@ Generating a Secure random Number\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n Whenever you need to generate a secure random number, you are highly\n-encouraged to use the Symfony\n-:class:`Symfony\\\\Component\\\\Security\\\\Core\\\\Util\\\\SecureRandom` class::\n+encouraged to use the \n+:phpfunction:`random_bytes` function::\n \n-    use Symfony\\Component\\Security\\Core\\Util\\SecureRandom;\n+    $random = random_bytes(10);\n \n-    $generator = new SecureRandom();\n-    $random = $generator->nextBytes(10);\n-\n-The\n-:method:`Symfony\\\\Component\\\\Security\\\\Core\\\\Util\\\\SecureRandom::nextBytes`\n-method returns a random string composed of the number of characters passed as\n-an argument (10 in the above example).\n-\n-The SecureRandom class works better when OpenSSL is installed. But when it's\n-not available, it falls back to an internal algorithm, which needs a seed file\n-to work correctly. Just pass a file name to enable it::\n-\n-    use Symfony\\Component\\Security\\Core\\Util\\SecureRandom;\n-\n-    $generator = new SecureRandom('/some/path/to/store/the/seed.txt');\n-\n-    $random = $generator->nextBytes(10);\n-    $hashedRandom = md5($random); // see tip below\n+The function returns a random string, suitable for cryptographic use, of\n+the number bytes passed as an argument (10 in the above example).\n \n .. note::\n \n     If you're using the Symfony Framework, you can get a secure random number\n     generator via the ``security.secure_random`` service.\n \n+.. note::\n+\n+    PHP versions 7.0.0 and up provide the ``random_bytes()`` function natively,","path":"components/security/secure_tools.rst","position":40,"original_position":40,"commit_id":"fe7b6099ac3a99e37ac34918566e13822a89286f","original_commit_id":"fe7b6099ac3a99e37ac34918566e13822a89286f","user":{"login":"OskarStark","id":995707,"avatar_url":"https://avatars.githubusercontent.com/u/995707?v=3","gravatar_id":"","url":"https://api.github.com/users/OskarStark","html_url":"https://github.com/OskarStark","followers_url":"https://api.github.com/users/OskarStark/followers","following_url":"https://api.github.com/users/OskarStark/following{/other_user}","gists_url":"https://api.github.com/users/OskarStark/gists{/gist_id}","starred_url":"https://api.github.com/users/OskarStark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OskarStark/subscriptions","organizations_url":"https://api.github.com/users/OskarStark/orgs","repos_url":"https://api.github.com/users/OskarStark/repos","events_url":"https://api.github.com/users/OskarStark/events{/privacy}","received_events_url":"https://api.github.com/users/OskarStark/received_events","type":"User","site_admin":false},"body":"Would write:\r\n\r\n``PHP 7 and up .... natively, for older versions we provide a polyfill.``\r\n\r\npolyfill should be a link to more information IMO","created_at":"2016-01-07T09:15:39Z","updated_at":"2016-01-07T09:15:39Z","html_url":"https://github.com/symfony/symfony-docs/pull/6104#discussion_r49053799","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/49053799"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6104#discussion_r49053799"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104","id":54994666,"html_url":"https://github.com/symfony/symfony-docs/pull/6104","diff_url":"https://github.com/symfony/symfony-docs/pull/6104.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/6104.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/6104","number":6104,"state":"open","locked":false,"title":"Fix #6103","user":{"login":"zsturgess","id":3624596,"avatar_url":"https://avatars.githubusercontent.com/u/3624596?v=3","gravatar_id":"","url":"https://api.github.com/users/zsturgess","html_url":"https://github.com/zsturgess","followers_url":"https://api.github.com/users/zsturgess/followers","following_url":"https://api.github.com/users/zsturgess/following{/other_user}","gists_url":"https://api.github.com/users/zsturgess/gists{/gist_id}","starred_url":"https://api.github.com/users/zsturgess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsturgess/subscriptions","organizations_url":"https://api.github.com/users/zsturgess/orgs","repos_url":"https://api.github.com/users/zsturgess/repos","events_url":"https://api.github.com/users/zsturgess/events{/privacy}","received_events_url":"https://api.github.com/users/zsturgess/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Doc fix?      | yes\r\n| New docs?     | no\r\n| Applies to    | >= 2.8\r\n| Fixed tickets | #6103 \r\n\r\nRe-written this page from talking about the deprecated SecureRandom class to talking about the random_bytes replacement.","created_at":"2016-01-04T16:42:10Z","updated_at":"2016-01-07T09:15:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"690062b89a1ee5064d2ee988434690a586599c66","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/6104/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/fe7b6099ac3a99e37ac34918566e13822a89286f","head":{"label":"zsturgess:secure-random-usage","ref":"secure-random-usage","sha":"fe7b6099ac3a99e37ac34918566e13822a89286f","user":{"login":"zsturgess","id":3624596,"avatar_url":"https://avatars.githubusercontent.com/u/3624596?v=3","gravatar_id":"","url":"https://api.github.com/users/zsturgess","html_url":"https://github.com/zsturgess","followers_url":"https://api.github.com/users/zsturgess/followers","following_url":"https://api.github.com/users/zsturgess/following{/other_user}","gists_url":"https://api.github.com/users/zsturgess/gists{/gist_id}","starred_url":"https://api.github.com/users/zsturgess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsturgess/subscriptions","organizations_url":"https://api.github.com/users/zsturgess/orgs","repos_url":"https://api.github.com/users/zsturgess/repos","events_url":"https://api.github.com/users/zsturgess/events{/privacy}","received_events_url":"https://api.github.com/users/zsturgess/received_events","type":"User","site_admin":false},"repo":{"id":48185413,"name":"symfony-docs","full_name":"zsturgess/symfony-docs","owner":{"login":"zsturgess","id":3624596,"avatar_url":"https://avatars.githubusercontent.com/u/3624596?v=3","gravatar_id":"","url":"https://api.github.com/users/zsturgess","html_url":"https://github.com/zsturgess","followers_url":"https://api.github.com/users/zsturgess/followers","following_url":"https://api.github.com/users/zsturgess/following{/other_user}","gists_url":"https://api.github.com/users/zsturgess/gists{/gist_id}","starred_url":"https://api.github.com/users/zsturgess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsturgess/subscriptions","organizations_url":"https://api.github.com/users/zsturgess/orgs","repos_url":"https://api.github.com/users/zsturgess/repos","events_url":"https://api.github.com/users/zsturgess/events{/privacy}","received_events_url":"https://api.github.com/users/zsturgess/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zsturgess/symfony-docs","description":"The Symfony documentation","fork":true,"url":"https://api.github.com/repos/zsturgess/symfony-docs","forks_url":"https://api.github.com/repos/zsturgess/symfony-docs/forks","keys_url":"https://api.github.com/repos/zsturgess/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zsturgess/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zsturgess/symfony-docs/teams","hooks_url":"https://api.github.com/repos/zsturgess/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/zsturgess/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/zsturgess/symfony-docs/events","assignees_url":"https://api.github.com/repos/zsturgess/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/zsturgess/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/zsturgess/symfony-docs/tags","blobs_url":"https://api.github.com/repos/zsturgess/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zsturgess/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zsturgess/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/zsturgess/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zsturgess/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/zsturgess/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/zsturgess/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/zsturgess/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/zsturgess/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/zsturgess/symfony-docs/subscription","commits_url":"https://api.github.com/repos/zsturgess/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/zsturgess/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/zsturgess/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/zsturgess/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/zsturgess/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/zsturgess/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zsturgess/symfony-docs/merges","archive_url":"https://api.github.com/repos/zsturgess/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zsturgess/symfony-docs/downloads","issues_url":"https://api.github.com/repos/zsturgess/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/zsturgess/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/zsturgess/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/zsturgess/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zsturgess/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/zsturgess/symfony-docs/releases{/id}","created_at":"2015-12-17T16:26:29Z","updated_at":"2015-12-17T16:26:33Z","pushed_at":"2016-01-04T17:14:08Z","git_url":"git://github.com/zsturgess/symfony-docs.git","ssh_url":"git@github.com:zsturgess/symfony-docs.git","clone_url":"https://github.com/zsturgess/symfony-docs.git","svn_url":"https://github.com/zsturgess/symfony-docs","homepage":"http://symfony.com/doc","size":33307,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.8"}},"base":{"label":"symfony:2.8","ref":"2.8","sha":"46ff6f16125dc7d98affcaf0a3d07721fb6e81c4","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"name":"symfony-docs","full_name":"symfony/symfony-docs","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","created_at":"2010-02-17T08:43:51Z","updated_at":"2016-01-06T16:25:00Z","pushed_at":"2016-01-06T18:50:46Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"http://symfony.com/doc","size":42569,"stargazers_count":1065,"watchers_count":1065,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2215,"mirror_url":null,"open_issues_count":301,"forks":2215,"open_issues":301,"watchers":1065,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6104"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6104"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6104/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6104/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/fe7b6099ac3a99e37ac34918566e13822a89286f"}}}}