{"action":"created","comment":{"url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/comments/194046052","pull_request_review_id":127147034,"id":194046052,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDA0NjA1Mg==","diff_hunk":"@@ -0,0 +1,93 @@\n+// libTorrent - BitTorrent library\n+// Copyright (C) 2005-2017, Jari Sundell\n+//\n+// This program is free software; you can redistribute it and/or modify\n+// it under the terms of the GNU General Public License as published by\n+// the Free Software Foundation; either version 2 of the License, or\n+// (at your option) any later version.\n+//\n+// This program is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU General Public License for more details.\n+//\n+// You should have received a copy of the GNU General Public License\n+// along with this program; if not, write to the Free Software\n+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n+//\n+// In addition, as a special exception, the copyright holders give\n+// permission to link the code of portions of this program with the\n+// OpenSSL library under certain conditions as described in each\n+// individual source file, and distribute linked combinations\n+// including the two.\n+//\n+// You must obey the GNU General Public License in all respects for\n+// all of the code used other than OpenSSL.  If you modify file(s)\n+// with this exception, you may extend this exception to your version\n+// of the file(s), but you are not obligated to do so.  If you do not\n+// wish to do so, delete this exception statement from your version.\n+// If you delete this exception statement from all source files in the\n+// program, then also delete it here.\n+//\n+// Contact:  Jari Sundell <jaris@ifi.uio.no>\n+//\n+//           Skomakerveien 33\n+//           3185 Skoppum, NORWAY\n+\n+#include \"uniform_rng.h\"\n+\n+#include <climits>\n+#include <unistd.h>\n+\n+#include \"config.h\"\n+#include \"globals.h\"\n+#include \"torrent/exceptions.h\"\n+\n+\n+namespace torrent {\n+\n+uniform_rng::uniform_rng() {\n+    unsigned int seed = cachedTime.usec() ^ (getpid() << 16) ^ getppid();","path":"src/utils/uniform_rng.cc","position":50,"original_position":50,"commit_id":"8d74573abcfa3ee9b013376497bd1fd8049db61d","original_commit_id":"8d74573abcfa3ee9b013376497bd1fd8049db61d","user":{"login":"ss23","id":191510,"node_id":"MDQ6VXNlcjE5MTUxMA==","avatar_url":"https://avatars2.githubusercontent.com/u/191510?v=4","gravatar_id":"","url":"https://api.github.com/users/ss23","html_url":"https://github.com/ss23","followers_url":"https://api.github.com/users/ss23/followers","following_url":"https://api.github.com/users/ss23/following{/other_user}","gists_url":"https://api.github.com/users/ss23/gists{/gist_id}","starred_url":"https://api.github.com/users/ss23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ss23/subscriptions","organizations_url":"https://api.github.com/users/ss23/orgs","repos_url":"https://api.github.com/users/ss23/repos","events_url":"https://api.github.com/users/ss23/events{/privacy}","received_events_url":"https://api.github.com/users/ss23/received_events","type":"User","site_admin":false},"body":"Could we seed with `RAND_bytes` if rtorrent was compiled with OpenSSL support? I realise this isn't meant to be cryptographically secure, but I don't think it'll hurt to make sure we're using a high quality seed.","created_at":"2018-06-08T12:48:00Z","updated_at":"2018-06-08T12:48:00Z","html_url":"https://github.com/rakshasa/libtorrent/pull/148#discussion_r194046052","pull_request_url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/comments/194046052"},"html":{"href":"https://github.com/rakshasa/libtorrent/pull/148#discussion_r194046052"},"pull_request":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148","id":110027502,"node_id":"MDExOlB1bGxSZXF1ZXN0MTEwMDI3NTAy","html_url":"https://github.com/rakshasa/libtorrent/pull/148","diff_url":"https://github.com/rakshasa/libtorrent/pull/148.diff","patch_url":"https://github.com/rakshasa/libtorrent/pull/148.patch","issue_url":"https://api.github.com/repos/rakshasa/libtorrent/issues/148","number":148,"state":"open","locked":false,"title":"uniform_rng - Uniform distribution random number generator","user":{"login":"pyroscope","id":679194,"node_id":"MDQ6VXNlcjY3OTE5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/679194?v=4","gravatar_id":"","url":"https://api.github.com/users/pyroscope","html_url":"https://github.com/pyroscope","followers_url":"https://api.github.com/users/pyroscope/followers","following_url":"https://api.github.com/users/pyroscope/following{/other_user}","gists_url":"https://api.github.com/users/pyroscope/gists{/gist_id}","starred_url":"https://api.github.com/users/pyroscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyroscope/subscriptions","organizations_url":"https://api.github.com/users/pyroscope/orgs","repos_url":"https://api.github.com/users/pyroscope/repos","events_url":"https://api.github.com/users/pyroscope/events{/privacy}","received_events_url":"https://api.github.com/users/pyroscope/received_events","type":"User","site_admin":false},"body":"This is the basis for a `system.rand` rtorrent command, and also a pre-cursor to fix entropy problems the numerous `random() % limit` calls have – namely using the lower low-quality bits of the PRNG, and having potential (or real) thread-safety problems.\r\n\r\n:bangbang: When testing the original `system.rand`  implementation based on `random()`, the number sequences were awfully unrandom.","created_at":"2017-03-09T23:14:47Z","updated_at":"2018-06-08T12:48:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9de8bd930f906463855c2b0372d26dfcc19fe329","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148/commits","review_comments_url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148/comments","review_comment_url":"https://api.github.com/repos/rakshasa/libtorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rakshasa/libtorrent/issues/148/comments","statuses_url":"https://api.github.com/repos/rakshasa/libtorrent/statuses/8d74573abcfa3ee9b013376497bd1fd8049db61d","head":{"label":"pyroscope:add-uniform_rng","ref":"add-uniform_rng","sha":"8d74573abcfa3ee9b013376497bd1fd8049db61d","user":{"login":"pyroscope","id":679194,"node_id":"MDQ6VXNlcjY3OTE5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/679194?v=4","gravatar_id":"","url":"https://api.github.com/users/pyroscope","html_url":"https://github.com/pyroscope","followers_url":"https://api.github.com/users/pyroscope/followers","following_url":"https://api.github.com/users/pyroscope/following{/other_user}","gists_url":"https://api.github.com/users/pyroscope/gists{/gist_id}","starred_url":"https://api.github.com/users/pyroscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyroscope/subscriptions","organizations_url":"https://api.github.com/users/pyroscope/orgs","repos_url":"https://api.github.com/users/pyroscope/repos","events_url":"https://api.github.com/users/pyroscope/events{/privacy}","received_events_url":"https://api.github.com/users/pyroscope/received_events","type":"User","site_admin":false},"repo":{"id":54054065,"node_id":"MDEwOlJlcG9zaXRvcnk1NDA1NDA2NQ==","name":"libtorrent","full_name":"pyroscope/libtorrent","owner":{"login":"pyroscope","id":679194,"node_id":"MDQ6VXNlcjY3OTE5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/679194?v=4","gravatar_id":"","url":"https://api.github.com/users/pyroscope","html_url":"https://github.com/pyroscope","followers_url":"https://api.github.com/users/pyroscope/followers","following_url":"https://api.github.com/users/pyroscope/following{/other_user}","gists_url":"https://api.github.com/users/pyroscope/gists{/gist_id}","starred_url":"https://api.github.com/users/pyroscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyroscope/subscriptions","organizations_url":"https://api.github.com/users/pyroscope/orgs","repos_url":"https://api.github.com/users/pyroscope/repos","events_url":"https://api.github.com/users/pyroscope/events{/privacy}","received_events_url":"https://api.github.com/users/pyroscope/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pyroscope/libtorrent","description":"libTorrent BitTorrent library","fork":true,"url":"https://api.github.com/repos/pyroscope/libtorrent","forks_url":"https://api.github.com/repos/pyroscope/libtorrent/forks","keys_url":"https://api.github.com/repos/pyroscope/libtorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyroscope/libtorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyroscope/libtorrent/teams","hooks_url":"https://api.github.com/repos/pyroscope/libtorrent/hooks","issue_events_url":"https://api.github.com/repos/pyroscope/libtorrent/issues/events{/number}","events_url":"https://api.github.com/repos/pyroscope/libtorrent/events","assignees_url":"https://api.github.com/repos/pyroscope/libtorrent/assignees{/user}","branches_url":"https://api.github.com/repos/pyroscope/libtorrent/branches{/branch}","tags_url":"https://api.github.com/repos/pyroscope/libtorrent/tags","blobs_url":"https://api.github.com/repos/pyroscope/libtorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyroscope/libtorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyroscope/libtorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyroscope/libtorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyroscope/libtorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/pyroscope/libtorrent/languages","stargazers_url":"https://api.github.com/repos/pyroscope/libtorrent/stargazers","contributors_url":"https://api.github.com/repos/pyroscope/libtorrent/contributors","subscribers_url":"https://api.github.com/repos/pyroscope/libtorrent/subscribers","subscription_url":"https://api.github.com/repos/pyroscope/libtorrent/subscription","commits_url":"https://api.github.com/repos/pyroscope/libtorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyroscope/libtorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyroscope/libtorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyroscope/libtorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyroscope/libtorrent/contents/{+path}","compare_url":"https://api.github.com/repos/pyroscope/libtorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyroscope/libtorrent/merges","archive_url":"https://api.github.com/repos/pyroscope/libtorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyroscope/libtorrent/downloads","issues_url":"https://api.github.com/repos/pyroscope/libtorrent/issues{/number}","pulls_url":"https://api.github.com/repos/pyroscope/libtorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/pyroscope/libtorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/pyroscope/libtorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyroscope/libtorrent/labels{/name}","releases_url":"https://api.github.com/repos/pyroscope/libtorrent/releases{/id}","deployments_url":"https://api.github.com/repos/pyroscope/libtorrent/deployments","created_at":"2016-03-16T17:48:54Z","updated_at":"2016-03-16T17:48:57Z","pushed_at":"2017-03-09T23:07:47Z","git_url":"git://github.com/pyroscope/libtorrent.git","ssh_url":"git@github.com:pyroscope/libtorrent.git","clone_url":"https://github.com/pyroscope/libtorrent.git","svn_url":"https://github.com/pyroscope/libtorrent","homepage":"http://rtorrent.net/downloads/","size":10637,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rakshasa:master","ref":"master","sha":"c167c5a9e0bcf0df23ae5efd91396aae0e37eb87","user":{"login":"rakshasa","id":475125,"node_id":"MDQ6VXNlcjQ3NTEyNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/475125?v=4","gravatar_id":"","url":"https://api.github.com/users/rakshasa","html_url":"https://github.com/rakshasa","followers_url":"https://api.github.com/users/rakshasa/followers","following_url":"https://api.github.com/users/rakshasa/following{/other_user}","gists_url":"https://api.github.com/users/rakshasa/gists{/gist_id}","starred_url":"https://api.github.com/users/rakshasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakshasa/subscriptions","organizations_url":"https://api.github.com/users/rakshasa/orgs","repos_url":"https://api.github.com/users/rakshasa/repos","events_url":"https://api.github.com/users/rakshasa/events{/privacy}","received_events_url":"https://api.github.com/users/rakshasa/received_events","type":"User","site_admin":false},"repo":{"id":2502647,"node_id":"MDEwOlJlcG9zaXRvcnkyNTAyNjQ3","name":"libtorrent","full_name":"rakshasa/libtorrent","owner":{"login":"rakshasa","id":475125,"node_id":"MDQ6VXNlcjQ3NTEyNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/475125?v=4","gravatar_id":"","url":"https://api.github.com/users/rakshasa","html_url":"https://github.com/rakshasa","followers_url":"https://api.github.com/users/rakshasa/followers","following_url":"https://api.github.com/users/rakshasa/following{/other_user}","gists_url":"https://api.github.com/users/rakshasa/gists{/gist_id}","starred_url":"https://api.github.com/users/rakshasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakshasa/subscriptions","organizations_url":"https://api.github.com/users/rakshasa/orgs","repos_url":"https://api.github.com/users/rakshasa/repos","events_url":"https://api.github.com/users/rakshasa/events{/privacy}","received_events_url":"https://api.github.com/users/rakshasa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rakshasa/libtorrent","description":"libTorrent BitTorrent library","fork":false,"url":"https://api.github.com/repos/rakshasa/libtorrent","forks_url":"https://api.github.com/repos/rakshasa/libtorrent/forks","keys_url":"https://api.github.com/repos/rakshasa/libtorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rakshasa/libtorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rakshasa/libtorrent/teams","hooks_url":"https://api.github.com/repos/rakshasa/libtorrent/hooks","issue_events_url":"https://api.github.com/repos/rakshasa/libtorrent/issues/events{/number}","events_url":"https://api.github.com/repos/rakshasa/libtorrent/events","assignees_url":"https://api.github.com/repos/rakshasa/libtorrent/assignees{/user}","branches_url":"https://api.github.com/repos/rakshasa/libtorrent/branches{/branch}","tags_url":"https://api.github.com/repos/rakshasa/libtorrent/tags","blobs_url":"https://api.github.com/repos/rakshasa/libtorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rakshasa/libtorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rakshasa/libtorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/rakshasa/libtorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rakshasa/libtorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/rakshasa/libtorrent/languages","stargazers_url":"https://api.github.com/repos/rakshasa/libtorrent/stargazers","contributors_url":"https://api.github.com/repos/rakshasa/libtorrent/contributors","subscribers_url":"https://api.github.com/repos/rakshasa/libtorrent/subscribers","subscription_url":"https://api.github.com/repos/rakshasa/libtorrent/subscription","commits_url":"https://api.github.com/repos/rakshasa/libtorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/rakshasa/libtorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/rakshasa/libtorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/rakshasa/libtorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/rakshasa/libtorrent/contents/{+path}","compare_url":"https://api.github.com/repos/rakshasa/libtorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rakshasa/libtorrent/merges","archive_url":"https://api.github.com/repos/rakshasa/libtorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rakshasa/libtorrent/downloads","issues_url":"https://api.github.com/repos/rakshasa/libtorrent/issues{/number}","pulls_url":"https://api.github.com/repos/rakshasa/libtorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/rakshasa/libtorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/rakshasa/libtorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rakshasa/libtorrent/labels{/name}","releases_url":"https://api.github.com/repos/rakshasa/libtorrent/releases{/id}","deployments_url":"https://api.github.com/repos/rakshasa/libtorrent/deployments","created_at":"2011-10-03T04:09:03Z","updated_at":"2018-06-07T15:38:52Z","pushed_at":"2018-06-07T15:38:49Z","git_url":"git://github.com/rakshasa/libtorrent.git","ssh_url":"git@github.com:rakshasa/libtorrent.git","clone_url":"https://github.com/rakshasa/libtorrent.git","svn_url":"https://github.com/rakshasa/libtorrent","homepage":"http://rtorrent.net/downloads/","size":10760,"stargazers_count":695,"watchers_count":695,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":167,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":167,"open_issues":33,"watchers":695,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148"},"html":{"href":"https://github.com/rakshasa/libtorrent/pull/148"},"issue":{"href":"https://api.github.com/repos/rakshasa/libtorrent/issues/148"},"comments":{"href":"https://api.github.com/repos/rakshasa/libtorrent/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rakshasa/libtorrent/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/rakshasa/libtorrent/statuses/8d74573abcfa3ee9b013376497bd1fd8049db61d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ss23"}}