{"action":"created","comment":{"url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/comments/39870949","id":39870949,"diff_hunk":"@@ -1,33 +1,14 @@\n library xcvbnm;\n \n-class Result {\n-  // bits\n-  double entropy;\n-  // estimation of actual crack time, in seconds.\n-  double crackTime;\n-  // same crack time, as a friendlier string:\n-  // \"instant\", \"6 minutes\", \"centuries\", etc.\n-  String crackTimeDisplay;\n-  // [0,1,2,3,4] if crack time is less than\n-  // [10**2, 10**4, 10**6, 10**8, Infinity].\n-  // (useful for implementing a strength bar.)\n-  int score;\n-  // how long it took xcvbnm to calculate an answer,\n-  // in milliseconds.\n-  int calcTime;\n-}\n-\n-class Xcvbnm {\n-  int getNaiveScore(String password) {\n-    if (password.length < 3) return 0;\n-    if (password.length < 5) return 1;\n-    if (password.length < 7) return 2;\n-    if (password.length < 9) return 3;\n-    if (password.length < 11) return 3;\n-    return 4;\n-  }\n+import 'src/xcvbnm_common.dart' hide Xcvbnm;\n+export 'src/xcvbnm_common.dart' hide Xcvbnm;\n+export 'src/xcvbnm_impl.dart';\n+import 'src/xcvbnm_impl.dart';\n \n-  Result estimate(String password, {List<String> userInputs}) {\n-    return new Result()..score = getNaiveScore(password);\n-  }\n+/**\n+ * the one and only entrypoint needed\n+ */\n+Result xcvbnm(String password, {List<String> userInputs}) {","path":"lib/xcvbnm.dart","position":40,"original_position":40,"commit_id":"b866d9611bddb7fb334f08988978f1e534cfeb9f","original_commit_id":"b866d9611bddb7fb334f08988978f1e534cfeb9f","user":{"login":"alextekartik","id":1721046,"avatar_url":"https://avatars.githubusercontent.com/u/1721046?v=3","gravatar_id":"","url":"https://api.github.com/users/alextekartik","html_url":"https://github.com/alextekartik","followers_url":"https://api.github.com/users/alextekartik/followers","following_url":"https://api.github.com/users/alextekartik/following{/other_user}","gists_url":"https://api.github.com/users/alextekartik/gists{/gist_id}","starred_url":"https://api.github.com/users/alextekartik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextekartik/subscriptions","organizations_url":"https://api.github.com/users/alextekartik/orgs","repos_url":"https://api.github.com/users/alextekartik/repos","events_url":"https://api.github.com/users/alextekartik/events{/privacy}","received_events_url":"https://api.github.com/users/alextekartik/received_events","type":"User","site_admin":false},"body":"The purpose of the added xcvbn() method was to add a convenient method for client of lib who do no care about mocking.\r\nIf you want your test code to use either the real or a mock implementation indeed you need to use a Xcvbnm object\r\n\r\n","created_at":"2015-09-18T15:57:42Z","updated_at":"2015-09-18T15:57:42Z","html_url":"https://github.com/exitlive/xcvbnm/pull/2#discussion_r39870949","pull_request_url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/comments/39870949"},"html":{"href":"https://github.com/exitlive/xcvbnm/pull/2#discussion_r39870949"},"pull_request":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2","id":44440930,"html_url":"https://github.com/exitlive/xcvbnm/pull/2","diff_url":"https://github.com/exitlive/xcvbnm/pull/2.diff","patch_url":"https://github.com/exitlive/xcvbnm/pull/2.patch","issue_url":"https://api.github.com/repos/exitlive/xcvbnm/issues/2","number":2,"state":"open","locked":false,"title":"Js port","user":{"login":"alextekartik","id":1721046,"avatar_url":"https://avatars.githubusercontent.com/u/1721046?v=3","gravatar_id":"","url":"https://api.github.com/users/alextekartik","html_url":"https://github.com/alextekartik","followers_url":"https://api.github.com/users/alextekartik/followers","following_url":"https://api.github.com/users/alextekartik/following{/other_user}","gists_url":"https://api.github.com/users/alextekartik/gists{/gist_id}","starred_url":"https://api.github.com/users/alextekartik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextekartik/subscriptions","organizations_url":"https://api.github.com/users/alextekartik/orgs","repos_url":"https://api.github.com/users/alextekartik/repos","events_url":"https://api.github.com/users/alextekartik/events{/privacy}","received_events_url":"https://api.github.com/users/alextekartik/received_events","type":"User","site_admin":false},"body":"first port of some functions from scoring.coffee and their associated unittest.","created_at":"2015-09-08T14:45:59Z","updated_at":"2015-09-18T15:57:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17f3de150ee3ed5917d40bdb7c7f79773b428f19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2/commits","review_comments_url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2/comments","review_comment_url":"https://api.github.com/repos/exitlive/xcvbnm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exitlive/xcvbnm/issues/2/comments","statuses_url":"https://api.github.com/repos/exitlive/xcvbnm/statuses/b866d9611bddb7fb334f08988978f1e534cfeb9f","head":{"label":"alextekartik:js-port","ref":"js-port","sha":"b866d9611bddb7fb334f08988978f1e534cfeb9f","user":{"login":"alextekartik","id":1721046,"avatar_url":"https://avatars.githubusercontent.com/u/1721046?v=3","gravatar_id":"","url":"https://api.github.com/users/alextekartik","html_url":"https://github.com/alextekartik","followers_url":"https://api.github.com/users/alextekartik/followers","following_url":"https://api.github.com/users/alextekartik/following{/other_user}","gists_url":"https://api.github.com/users/alextekartik/gists{/gist_id}","starred_url":"https://api.github.com/users/alextekartik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextekartik/subscriptions","organizations_url":"https://api.github.com/users/alextekartik/orgs","repos_url":"https://api.github.com/users/alextekartik/repos","events_url":"https://api.github.com/users/alextekartik/events{/privacy}","received_events_url":"https://api.github.com/users/alextekartik/received_events","type":"User","site_admin":false},"repo":{"id":42115132,"name":"xcvbnm-dart","full_name":"alextekartik/xcvbnm-dart","owner":{"login":"alextekartik","id":1721046,"avatar_url":"https://avatars.githubusercontent.com/u/1721046?v=3","gravatar_id":"","url":"https://api.github.com/users/alextekartik","html_url":"https://github.com/alextekartik","followers_url":"https://api.github.com/users/alextekartik/followers","following_url":"https://api.github.com/users/alextekartik/following{/other_user}","gists_url":"https://api.github.com/users/alextekartik/gists{/gist_id}","starred_url":"https://api.github.com/users/alextekartik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextekartik/subscriptions","organizations_url":"https://api.github.com/users/alextekartik/orgs","repos_url":"https://api.github.com/users/alextekartik/repos","events_url":"https://api.github.com/users/alextekartik/events{/privacy}","received_events_url":"https://api.github.com/users/alextekartik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alextekartik/xcvbnm-dart","description":"","fork":true,"url":"https://api.github.com/repos/alextekartik/xcvbnm-dart","forks_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/forks","keys_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/teams","hooks_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/hooks","issue_events_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/issues/events{/number}","events_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/events","assignees_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/assignees{/user}","branches_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/branches{/branch}","tags_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/tags","blobs_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/git/refs{/sha}","trees_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/statuses/{sha}","languages_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/languages","stargazers_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/stargazers","contributors_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/contributors","subscribers_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/subscribers","subscription_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/subscription","commits_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/commits{/sha}","git_commits_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/git/commits{/sha}","comments_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/comments{/number}","issue_comment_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/issues/comments{/number}","contents_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/contents/{+path}","compare_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/merges","archive_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/downloads","issues_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/issues{/number}","pulls_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/pulls{/number}","milestones_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/milestones{/number}","notifications_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/labels{/name}","releases_url":"https://api.github.com/repos/alextekartik/xcvbnm-dart/releases{/id}","created_at":"2015-09-08T13:50:43Z","updated_at":"2015-09-08T13:51:10Z","pushed_at":"2015-09-17T14:02:56Z","git_url":"git://github.com/alextekartik/xcvbnm-dart.git","ssh_url":"git@github.com:alextekartik/xcvbnm-dart.git","clone_url":"https://github.com/alextekartik/xcvbnm-dart.git","svn_url":"https://github.com/alextekartik/xcvbnm-dart","homepage":null,"size":572,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"exitlive:js-port","ref":"js-port","sha":"ee06974a366148a83ef6dff1e9398bf6e474f40f","user":{"login":"exitlive","id":6476932,"avatar_url":"https://avatars.githubusercontent.com/u/6476932?v=3","gravatar_id":"","url":"https://api.github.com/users/exitlive","html_url":"https://github.com/exitlive","followers_url":"https://api.github.com/users/exitlive/followers","following_url":"https://api.github.com/users/exitlive/following{/other_user}","gists_url":"https://api.github.com/users/exitlive/gists{/gist_id}","starred_url":"https://api.github.com/users/exitlive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exitlive/subscriptions","organizations_url":"https://api.github.com/users/exitlive/orgs","repos_url":"https://api.github.com/users/exitlive/repos","events_url":"https://api.github.com/users/exitlive/events{/privacy}","received_events_url":"https://api.github.com/users/exitlive/received_events","type":"Organization","site_admin":false},"repo":{"id":40979976,"name":"xcvbnm","full_name":"exitlive/xcvbnm","owner":{"login":"exitlive","id":6476932,"avatar_url":"https://avatars.githubusercontent.com/u/6476932?v=3","gravatar_id":"","url":"https://api.github.com/users/exitlive","html_url":"https://github.com/exitlive","followers_url":"https://api.github.com/users/exitlive/followers","following_url":"https://api.github.com/users/exitlive/following{/other_user}","gists_url":"https://api.github.com/users/exitlive/gists{/gist_id}","starred_url":"https://api.github.com/users/exitlive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exitlive/subscriptions","organizations_url":"https://api.github.com/users/exitlive/orgs","repos_url":"https://api.github.com/users/exitlive/repos","events_url":"https://api.github.com/users/exitlive/events{/privacy}","received_events_url":"https://api.github.com/users/exitlive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exitlive/xcvbnm","description":"","fork":false,"url":"https://api.github.com/repos/exitlive/xcvbnm","forks_url":"https://api.github.com/repos/exitlive/xcvbnm/forks","keys_url":"https://api.github.com/repos/exitlive/xcvbnm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exitlive/xcvbnm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exitlive/xcvbnm/teams","hooks_url":"https://api.github.com/repos/exitlive/xcvbnm/hooks","issue_events_url":"https://api.github.com/repos/exitlive/xcvbnm/issues/events{/number}","events_url":"https://api.github.com/repos/exitlive/xcvbnm/events","assignees_url":"https://api.github.com/repos/exitlive/xcvbnm/assignees{/user}","branches_url":"https://api.github.com/repos/exitlive/xcvbnm/branches{/branch}","tags_url":"https://api.github.com/repos/exitlive/xcvbnm/tags","blobs_url":"https://api.github.com/repos/exitlive/xcvbnm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exitlive/xcvbnm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exitlive/xcvbnm/git/refs{/sha}","trees_url":"https://api.github.com/repos/exitlive/xcvbnm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exitlive/xcvbnm/statuses/{sha}","languages_url":"https://api.github.com/repos/exitlive/xcvbnm/languages","stargazers_url":"https://api.github.com/repos/exitlive/xcvbnm/stargazers","contributors_url":"https://api.github.com/repos/exitlive/xcvbnm/contributors","subscribers_url":"https://api.github.com/repos/exitlive/xcvbnm/subscribers","subscription_url":"https://api.github.com/repos/exitlive/xcvbnm/subscription","commits_url":"https://api.github.com/repos/exitlive/xcvbnm/commits{/sha}","git_commits_url":"https://api.github.com/repos/exitlive/xcvbnm/git/commits{/sha}","comments_url":"https://api.github.com/repos/exitlive/xcvbnm/comments{/number}","issue_comment_url":"https://api.github.com/repos/exitlive/xcvbnm/issues/comments{/number}","contents_url":"https://api.github.com/repos/exitlive/xcvbnm/contents/{+path}","compare_url":"https://api.github.com/repos/exitlive/xcvbnm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exitlive/xcvbnm/merges","archive_url":"https://api.github.com/repos/exitlive/xcvbnm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exitlive/xcvbnm/downloads","issues_url":"https://api.github.com/repos/exitlive/xcvbnm/issues{/number}","pulls_url":"https://api.github.com/repos/exitlive/xcvbnm/pulls{/number}","milestones_url":"https://api.github.com/repos/exitlive/xcvbnm/milestones{/number}","notifications_url":"https://api.github.com/repos/exitlive/xcvbnm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exitlive/xcvbnm/labels{/name}","releases_url":"https://api.github.com/repos/exitlive/xcvbnm/releases{/id}","created_at":"2015-08-18T15:26:58Z","updated_at":"2015-08-21T12:19:05Z","pushed_at":"2015-09-17T14:02:56Z","git_url":"git://github.com/exitlive/xcvbnm.git","ssh_url":"git@github.com:exitlive/xcvbnm.git","clone_url":"https://github.com/exitlive/xcvbnm.git","svn_url":"https://github.com/exitlive/xcvbnm","homepage":null,"size":1336,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2"},"html":{"href":"https://github.com/exitlive/xcvbnm/pull/2"},"issue":{"href":"https://api.github.com/repos/exitlive/xcvbnm/issues/2"},"comments":{"href":"https://api.github.com/repos/exitlive/xcvbnm/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exitlive/xcvbnm/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/exitlive/xcvbnm/statuses/b866d9611bddb7fb334f08988978f1e534cfeb9f"}}}}