{"action":"created","comment":{"url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/comments/31009621","id":31009621,"diff_hunk":"@@ -0,0 +1,249 @@\n+var SeedGeneration\n+(function () {\n+  'use strict';\n+  SeedGeneration = function (key, nonce) {\n+\t\tthis.rounds = 20\n+\t\tthis.sigmaWords = [0x61707865, 0x3320646e, 0x79622d32, 0x6b206574]\n+\t\tthis.keyWords = []\n+\t\tthis.nonceWords = [0, 0]\n+\t\tthis.counterWords = [0, 0]\n+\t\t\n+\t\tthis.block = []\t\n+\t\tthis.blockUsed = 64\t\n+\t\tthis.setKey(key)\n+\t\tthis.setNonce(nonce)\n+\t}\n+\tSeedGeneration.prototype.setKey = function(key) {\n+\t\tfor (var i = 0, j = 0; i < 8; i++, j += 4) {\n+\t\t\tthis.keyWords[i] = (key[j] & 0xff)\t\t|\n+\t\t\t\t\t\t\t  ((key[j+1] & 0xff)<<8)  |\n+\t\t\t\t\t\t\t  ((key[j+2] & 0xff)<<16) |\n+\t\t\t\t\t\t\t  ((key[j+3] & 0xff)<<24)\n+\t\t}\n+\t\tthis._reset()\n+\t}\n+\tSeedGeneration.prototype.setNonce = function(nonce) {\n+\t\tthis.nonceWords[0] = (nonce[0] & 0xff)\t  |\n+\t\t\t\t\t\t\t((nonce[1] & 0xff)<<8)  |\n+\t\t\t\t\t\t\t((nonce[2] & 0xff)<<16) |\n+\t\t\t\t\t\t\t((nonce[3] & 0xff)<<24)\n+\t\tthis.nonceWords[1] = (nonce[4] & 0xff)\t  |\n+\t\t\t\t\t\t\t((nonce[5] & 0xff)<<8)  |\n+\t\t\t\t\t\t\t((nonce[6] & 0xff)<<16) |\n+\t\t\t\t\t\t\t((nonce[7] & 0xff)<<24)\n+\t\tthis._reset()\n+\t}\n+\tSeedGeneration.prototype.getBytes = function(numberOfBytes) {\n+\t\tvar out = new Array(numberOfBytes)\n+\t\tfor (var i = 0; i < numberOfBytes; i++) {\n+\t\t\tif (this.blockUsed === 64) {\n+\t\t\t\tthis._generateBlock()\n+\t\t\t\tthis._incrementCounter()\n+\t\t\t\tthis.blockUsed = 0\n+\t\t\t}\n+\t\t\tout[i] = this.block[this.blockUsed]\n+\t\t\tthis.blockUsed++\n+\t\t}\n+\t\treturn out\n+\t}\n+\tSeedGeneration.prototype.getHexString = function(numberOfBytes) {\n+\t\tvar hex=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']\n+\t\tvar out = []\n+\t\tvar bytes = this.getBytes(numberOfBytes)\n+\t\tfor(var i = 0; i < bytes.length; i++) {\n+\t\t\tout.push(hex[(bytes[i] >> 4) & 15])\n+\t\t\tout.push(hex[bytes[i] & 15])\n+\t\t}\n+\t\treturn out.join('')\n+\t}\n+\tSeedGeneration.prototype._reset = function() {\n+\t  //reset \n+\t\tthis.counterWords[0] = 0\n+\t\tthis.counterWords[1] = 0\n+\t\tthis.blockUsed = 64\n+\t}\n+\tSeedGeneration.prototype._incrementCounter = function() {\n+\t\t// Note: maximum 2^64 blocks.\n+\t\tthis.counterWords[0] = (this.counterWords[0] + 1) & 0xffffffff\n+\t\tif (this.counterWords[0] === 0) {\n+\t\t\tthis.counterWords[1] = (this.counterWords[1] + 1) & 0xffffffff\n+\t\t}\n+\t}\n+\tSeedGeneration.prototype._generateBlock = function() {","path":"templates/includes/otr/js/lib/SeedGeneration.js","position":72,"original_position":72,"commit_id":"0d8e63aa0940c42f5ebf929f6d89585306d106b4","original_commit_id":"0d8e63aa0940c42f5ebf929f6d89585306d106b4","user":{"login":"tonghuix","id":423703,"avatar_url":"https://avatars.githubusercontent.com/u/423703?v=3","gravatar_id":"","url":"https://api.github.com/users/tonghuix","html_url":"https://github.com/tonghuix","followers_url":"https://api.github.com/users/tonghuix/followers","following_url":"https://api.github.com/users/tonghuix/following{/other_user}","gists_url":"https://api.github.com/users/tonghuix/gists{/gist_id}","starred_url":"https://api.github.com/users/tonghuix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonghuix/subscriptions","organizations_url":"https://api.github.com/users/tonghuix/orgs","repos_url":"https://api.github.com/users/tonghuix/repos","events_url":"https://api.github.com/users/tonghuix/events{/privacy}","received_events_url":"https://api.github.com/users/tonghuix/received_events","type":"User","site_admin":false},"body":"It is better you writing a doc about this function.","created_at":"2015-05-26T07:28:25Z","updated_at":"2015-05-26T07:28:25Z","html_url":"https://github.com/beijinglug/lets-chat/pull/2#discussion_r31009621","pull_request_url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/comments/31009621"},"html":{"href":"https://github.com/beijinglug/lets-chat/pull/2#discussion_r31009621"},"pull_request":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2","id":36146507,"html_url":"https://github.com/beijinglug/lets-chat/pull/2","diff_url":"https://github.com/beijinglug/lets-chat/pull/2.diff","patch_url":"https://github.com/beijinglug/lets-chat/pull/2.patch","issue_url":"https://api.github.com/repos/beijinglug/lets-chat/issues/2","number":2,"state":"open","locked":false,"title":"Seed Generation ","user":{"login":"fallacy321","id":3140219,"avatar_url":"https://avatars.githubusercontent.com/u/3140219?v=3","gravatar_id":"","url":"https://api.github.com/users/fallacy321","html_url":"https://github.com/fallacy321","followers_url":"https://api.github.com/users/fallacy321/followers","following_url":"https://api.github.com/users/fallacy321/following{/other_user}","gists_url":"https://api.github.com/users/fallacy321/gists{/gist_id}","starred_url":"https://api.github.com/users/fallacy321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallacy321/subscriptions","organizations_url":"https://api.github.com/users/fallacy321/orgs","repos_url":"https://api.github.com/users/fallacy321/repos","events_url":"https://api.github.com/users/fallacy321/events{/privacy}","received_events_url":"https://api.github.com/users/fallacy321/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-25T15:43:39Z","updated_at":"2015-05-26T07:28:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57219d1c9ea66889422aa8eee1023a3a6e6fd049","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2/commits","review_comments_url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2/comments","review_comment_url":"https://api.github.com/repos/beijinglug/lets-chat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/beijinglug/lets-chat/issues/2/comments","statuses_url":"https://api.github.com/repos/beijinglug/lets-chat/statuses/0d8e63aa0940c42f5ebf929f6d89585306d106b4","head":{"label":"fallacy321:master","ref":"master","sha":"0d8e63aa0940c42f5ebf929f6d89585306d106b4","user":{"login":"fallacy321","id":3140219,"avatar_url":"https://avatars.githubusercontent.com/u/3140219?v=3","gravatar_id":"","url":"https://api.github.com/users/fallacy321","html_url":"https://github.com/fallacy321","followers_url":"https://api.github.com/users/fallacy321/followers","following_url":"https://api.github.com/users/fallacy321/following{/other_user}","gists_url":"https://api.github.com/users/fallacy321/gists{/gist_id}","starred_url":"https://api.github.com/users/fallacy321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallacy321/subscriptions","organizations_url":"https://api.github.com/users/fallacy321/orgs","repos_url":"https://api.github.com/users/fallacy321/repos","events_url":"https://api.github.com/users/fallacy321/events{/privacy}","received_events_url":"https://api.github.com/users/fallacy321/received_events","type":"User","site_admin":false},"repo":{"id":32520745,"name":"lets-chat","full_name":"fallacy321/lets-chat","owner":{"login":"fallacy321","id":3140219,"avatar_url":"https://avatars.githubusercontent.com/u/3140219?v=3","gravatar_id":"","url":"https://api.github.com/users/fallacy321","html_url":"https://github.com/fallacy321","followers_url":"https://api.github.com/users/fallacy321/followers","following_url":"https://api.github.com/users/fallacy321/following{/other_user}","gists_url":"https://api.github.com/users/fallacy321/gists{/gist_id}","starred_url":"https://api.github.com/users/fallacy321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallacy321/subscriptions","organizations_url":"https://api.github.com/users/fallacy321/orgs","repos_url":"https://api.github.com/users/fallacy321/repos","events_url":"https://api.github.com/users/fallacy321/events{/privacy}","received_events_url":"https://api.github.com/users/fallacy321/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fallacy321/lets-chat","description":"Self-hosted chat app for small teams","fork":true,"url":"https://api.github.com/repos/fallacy321/lets-chat","forks_url":"https://api.github.com/repos/fallacy321/lets-chat/forks","keys_url":"https://api.github.com/repos/fallacy321/lets-chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fallacy321/lets-chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fallacy321/lets-chat/teams","hooks_url":"https://api.github.com/repos/fallacy321/lets-chat/hooks","issue_events_url":"https://api.github.com/repos/fallacy321/lets-chat/issues/events{/number}","events_url":"https://api.github.com/repos/fallacy321/lets-chat/events","assignees_url":"https://api.github.com/repos/fallacy321/lets-chat/assignees{/user}","branches_url":"https://api.github.com/repos/fallacy321/lets-chat/branches{/branch}","tags_url":"https://api.github.com/repos/fallacy321/lets-chat/tags","blobs_url":"https://api.github.com/repos/fallacy321/lets-chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fallacy321/lets-chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fallacy321/lets-chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/fallacy321/lets-chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fallacy321/lets-chat/statuses/{sha}","languages_url":"https://api.github.com/repos/fallacy321/lets-chat/languages","stargazers_url":"https://api.github.com/repos/fallacy321/lets-chat/stargazers","contributors_url":"https://api.github.com/repos/fallacy321/lets-chat/contributors","subscribers_url":"https://api.github.com/repos/fallacy321/lets-chat/subscribers","subscription_url":"https://api.github.com/repos/fallacy321/lets-chat/subscription","commits_url":"https://api.github.com/repos/fallacy321/lets-chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/fallacy321/lets-chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/fallacy321/lets-chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/fallacy321/lets-chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/fallacy321/lets-chat/contents/{+path}","compare_url":"https://api.github.com/repos/fallacy321/lets-chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fallacy321/lets-chat/merges","archive_url":"https://api.github.com/repos/fallacy321/lets-chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fallacy321/lets-chat/downloads","issues_url":"https://api.github.com/repos/fallacy321/lets-chat/issues{/number}","pulls_url":"https://api.github.com/repos/fallacy321/lets-chat/pulls{/number}","milestones_url":"https://api.github.com/repos/fallacy321/lets-chat/milestones{/number}","notifications_url":"https://api.github.com/repos/fallacy321/lets-chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fallacy321/lets-chat/labels{/name}","releases_url":"https://api.github.com/repos/fallacy321/lets-chat/releases{/id}","created_at":"2015-03-19T12:46:51Z","updated_at":"2015-04-12T08:11:06Z","pushed_at":"2015-05-25T12:56:28Z","git_url":"git://github.com/fallacy321/lets-chat.git","ssh_url":"git@github.com:fallacy321/lets-chat.git","clone_url":"https://github.com/fallacy321/lets-chat.git","svn_url":"https://github.com/fallacy321/lets-chat","homepage":"http://sdelements.github.io/lets-chat","size":21259,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"beijinglug:master","ref":"master","sha":"4e3f925d94fe1057f5cbd48b41637443adb24667","user":{"login":"beijinglug","id":9346802,"avatar_url":"https://avatars.githubusercontent.com/u/9346802?v=3","gravatar_id":"","url":"https://api.github.com/users/beijinglug","html_url":"https://github.com/beijinglug","followers_url":"https://api.github.com/users/beijinglug/followers","following_url":"https://api.github.com/users/beijinglug/following{/other_user}","gists_url":"https://api.github.com/users/beijinglug/gists{/gist_id}","starred_url":"https://api.github.com/users/beijinglug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beijinglug/subscriptions","organizations_url":"https://api.github.com/users/beijinglug/orgs","repos_url":"https://api.github.com/users/beijinglug/repos","events_url":"https://api.github.com/users/beijinglug/events{/privacy}","received_events_url":"https://api.github.com/users/beijinglug/received_events","type":"Organization","site_admin":false},"repo":{"id":34044648,"name":"lets-chat","full_name":"beijinglug/lets-chat","owner":{"login":"beijinglug","id":9346802,"avatar_url":"https://avatars.githubusercontent.com/u/9346802?v=3","gravatar_id":"","url":"https://api.github.com/users/beijinglug","html_url":"https://github.com/beijinglug","followers_url":"https://api.github.com/users/beijinglug/followers","following_url":"https://api.github.com/users/beijinglug/following{/other_user}","gists_url":"https://api.github.com/users/beijinglug/gists{/gist_id}","starred_url":"https://api.github.com/users/beijinglug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beijinglug/subscriptions","organizations_url":"https://api.github.com/users/beijinglug/orgs","repos_url":"https://api.github.com/users/beijinglug/repos","events_url":"https://api.github.com/users/beijinglug/events{/privacy}","received_events_url":"https://api.github.com/users/beijinglug/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/beijinglug/lets-chat","description":"Self-hosted chat app for small teams","fork":true,"url":"https://api.github.com/repos/beijinglug/lets-chat","forks_url":"https://api.github.com/repos/beijinglug/lets-chat/forks","keys_url":"https://api.github.com/repos/beijinglug/lets-chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beijinglug/lets-chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beijinglug/lets-chat/teams","hooks_url":"https://api.github.com/repos/beijinglug/lets-chat/hooks","issue_events_url":"https://api.github.com/repos/beijinglug/lets-chat/issues/events{/number}","events_url":"https://api.github.com/repos/beijinglug/lets-chat/events","assignees_url":"https://api.github.com/repos/beijinglug/lets-chat/assignees{/user}","branches_url":"https://api.github.com/repos/beijinglug/lets-chat/branches{/branch}","tags_url":"https://api.github.com/repos/beijinglug/lets-chat/tags","blobs_url":"https://api.github.com/repos/beijinglug/lets-chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beijinglug/lets-chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beijinglug/lets-chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/beijinglug/lets-chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beijinglug/lets-chat/statuses/{sha}","languages_url":"https://api.github.com/repos/beijinglug/lets-chat/languages","stargazers_url":"https://api.github.com/repos/beijinglug/lets-chat/stargazers","contributors_url":"https://api.github.com/repos/beijinglug/lets-chat/contributors","subscribers_url":"https://api.github.com/repos/beijinglug/lets-chat/subscribers","subscription_url":"https://api.github.com/repos/beijinglug/lets-chat/subscription","commits_url":"https://api.github.com/repos/beijinglug/lets-chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/beijinglug/lets-chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/beijinglug/lets-chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/beijinglug/lets-chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/beijinglug/lets-chat/contents/{+path}","compare_url":"https://api.github.com/repos/beijinglug/lets-chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beijinglug/lets-chat/merges","archive_url":"https://api.github.com/repos/beijinglug/lets-chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beijinglug/lets-chat/downloads","issues_url":"https://api.github.com/repos/beijinglug/lets-chat/issues{/number}","pulls_url":"https://api.github.com/repos/beijinglug/lets-chat/pulls{/number}","milestones_url":"https://api.github.com/repos/beijinglug/lets-chat/milestones{/number}","notifications_url":"https://api.github.com/repos/beijinglug/lets-chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beijinglug/lets-chat/labels{/name}","releases_url":"https://api.github.com/repos/beijinglug/lets-chat/releases{/id}","created_at":"2015-04-16T08:48:31Z","updated_at":"2015-05-09T21:47:17Z","pushed_at":"2015-05-25T15:43:39Z","git_url":"git://github.com/beijinglug/lets-chat.git","ssh_url":"git@github.com:beijinglug/lets-chat.git","clone_url":"https://github.com/beijinglug/lets-chat.git","svn_url":"https://github.com/beijinglug/lets-chat","homepage":"http://sdelements.github.io/lets-chat","size":22448,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2"},"html":{"href":"https://github.com/beijinglug/lets-chat/pull/2"},"issue":{"href":"https://api.github.com/repos/beijinglug/lets-chat/issues/2"},"comments":{"href":"https://api.github.com/repos/beijinglug/lets-chat/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/beijinglug/lets-chat/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/beijinglug/lets-chat/statuses/0d8e63aa0940c42f5ebf929f6d89585306d106b4"}}}}