pwned 1.2.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,149 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Exception: Pwned::Error
8
-
9
- &mdash; Documentation by YARD 0.9.12
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Pwned::Error";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (E)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span>
41
- &raquo;
42
- <span class="title">Error</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Exception: Pwned::Error
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">StandardError</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">StandardError</li>
78
-
79
- <li class="next">Pwned::Error</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/pwned/error.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Overview</h2><div class="docstring">
105
- <div class="discussion">
106
-
107
- <p>A base error for HTTP request errors that may be thrown when making
108
- requests to the Pwned Passwords API.</p>
109
-
110
-
111
- </div>
112
- </div>
113
- <div class="tags">
114
-
115
-
116
- <p class="tag_title">See Also:</p>
117
- <ul class="see">
118
-
119
- <li><span class='object_link'><a href="Password.html#pwned%3F-instance_method" title="Pwned::Password#pwned? (method)">Password#pwned?</a></span></li>
120
-
121
- <li><span class='object_link'><a href="Password.html#pwned_count-instance_method" title="Pwned::Password#pwned_count (method)">Password#pwned_count</a></span></li>
122
-
123
- </ul>
124
-
125
- </div><div id="subclasses">
126
- <h2>Direct Known Subclasses</h2>
127
- <p class="children"><span class='object_link'><a href="TimeoutError.html" title="Pwned::TimeoutError (class)">TimeoutError</a></span></p>
128
- </div>
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
- </div>
140
-
141
- <div id="footer">
142
- Generated on Wed Mar 14 11:06:58 2018 by
143
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
144
- 0.9.12 (ruby-2.5.0).
145
- </div>
146
-
147
- </div>
148
- </body>
149
- </html>
@@ -1,925 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Pwned::Password
8
-
9
- &mdash; Documentation by YARD 0.9.12
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Pwned::Password";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (P)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span>
41
- &raquo;
42
- <span class="title">Password</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Class: Pwned::Password
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">Object</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">Pwned::Password</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/pwned/password.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>This class represents a password. It does all the work of talking to the
106
- Pwned Passwords API to find out if the password has been pwned.</p>
107
-
108
-
109
- </div>
110
- </div>
111
- <div class="tags">
112
-
113
-
114
- <p class="tag_title">See Also:</p>
115
- <ul class="see">
116
-
117
- <li><a href="https://haveibeenpwned.com/API/v2#PwnedPasswords" target="_parent" title="https://haveibeenpwned.com/API/v2#PwnedPasswords">https://haveibeenpwned.com/API/v2#PwnedPasswords</a></li>
118
-
119
- </ul>
120
-
121
- </div>
122
- <h2>Constant Summary</h2>
123
- <dl class="constants">
124
-
125
- <dt id="API_URL-constant" class="">API_URL =
126
- <div class="docstring">
127
- <div class="discussion">
128
-
129
- <p>The base URL for the Pwned Passwords API</p>
130
-
131
-
132
- </div>
133
- </div>
134
- <div class="tags">
135
-
136
-
137
- </div>
138
- </dt>
139
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://api.pwnedpasswords.com/range/</span><span class='tstring_end'>&quot;</span></span></pre></dd>
140
-
141
- <dt id="HASH_PREFIX_LENGTH-constant" class="">HASH_PREFIX_LENGTH =
142
- <div class="docstring">
143
- <div class="discussion">
144
-
145
- <p>The number of characters from the start of the hash of the password that
146
- are used to search for the range of passwords.</p>
147
-
148
-
149
- </div>
150
- </div>
151
- <div class="tags">
152
-
153
-
154
- </div>
155
- </dt>
156
- <dd><pre class="code"><span class='int'>5</span></pre></dd>
157
-
158
- <dt id="SHA1_LENGTH-constant" class="">SHA1_LENGTH =
159
- <div class="docstring">
160
- <div class="discussion">
161
-
162
- <p>The total length of a SHA1 hash</p>
163
-
164
-
165
- </div>
166
- </div>
167
- <div class="tags">
168
-
169
-
170
- </div>
171
- </dt>
172
- <dd><pre class="code"><span class='int'>40</span></pre></dd>
173
-
174
- <dt id="DEFAULT_REQUEST_OPTIONS-constant" class="">DEFAULT_REQUEST_OPTIONS =
175
- <div class="docstring">
176
- <div class="discussion">
177
-
178
- <p>The default request options that are used to make HTTP requests to the API.
179
- A user agent is provided as requested in the documentation.</p>
180
-
181
-
182
- </div>
183
- </div>
184
- <div class="tags">
185
-
186
-
187
- <p class="tag_title">See Also:</p>
188
- <ul class="see">
189
-
190
- <li><a href="https://haveibeenpwned.com/API/v2#UserAgent" target="_parent" title="https://haveibeenpwned.com/API/v2#UserAgent">https://haveibeenpwned.com/API/v2#UserAgent</a></li>
191
-
192
- </ul>
193
-
194
- </div>
195
- </dt>
196
- <dd><pre class="code"><span class='lbrace'>{</span>
197
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>User-Agent</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ruby Pwned::Password </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Pwned.html#VERSION-constant" title="Pwned::VERSION (constant)">VERSION</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
198
- <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
199
-
200
- </dl>
201
-
202
-
203
-
204
-
205
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
206
- <ul class="summary">
207
-
208
- <li class="public ">
209
- <span class="summary_signature">
210
-
211
- <a href="#password-instance_method" title="#password (instance method)">#<strong>password</strong> &#x21d2; String </a>
212
-
213
-
214
-
215
- </span>
216
-
217
-
218
-
219
-
220
- <span class="note title readonly">readonly</span>
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- <span class="summary_desc"><div class='inline'>
231
- <p>The password that is being checked.</p>
232
- </div></span>
233
-
234
- </li>
235
-
236
-
237
- </ul>
238
-
239
-
240
-
241
-
242
-
243
- <h2>
244
- Instance Method Summary
245
- <small><a href="#" class="summary_toggle">collapse</a></small>
246
- </h2>
247
-
248
- <ul class="summary">
249
-
250
- <li class="public ">
251
- <span class="summary_signature">
252
-
253
- <a href="#hashed_password-instance_method" title="#hashed_password (instance method)">#<strong>hashed_password</strong> &#x21d2; String </a>
254
-
255
-
256
-
257
- </span>
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
- <span class="summary_desc"><div class='inline'>
268
- <p>Returns the full SHA1 hash of the given password in uppercase.</p>
269
- </div></span>
270
-
271
- </li>
272
-
273
-
274
- <li class="public ">
275
- <span class="summary_signature">
276
-
277
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(password, request_options = {}) &#x21d2; Boolean </a>
278
-
279
-
280
-
281
- </span>
282
-
283
-
284
- <span class="note title constructor">constructor</span>
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
- <span class="summary_desc"><div class='inline'>
294
- <p>Creates a new password object.</p>
295
- </div></span>
296
-
297
- </li>
298
-
299
-
300
- <li class="public ">
301
- <span class="summary_signature">
302
-
303
- <a href="#pwned%3F-instance_method" title="#pwned? (instance method)">#<strong>pwned?</strong> &#x21d2; Boolean </a>
304
-
305
-
306
-
307
- </span>
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
- <span class="summary_desc"><div class='inline'>
318
- <p><code>true</code> when the password has been pwned.</p>
319
- </div></span>
320
-
321
- </li>
322
-
323
-
324
- <li class="public ">
325
- <span class="summary_signature">
326
-
327
- <a href="#pwned_count-instance_method" title="#pwned_count (instance method)">#<strong>pwned_count</strong> &#x21d2; Integer </a>
328
-
329
-
330
-
331
- </span>
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
- <span class="summary_desc"><div class='inline'>
342
- <p>The number of times the password has been pwned.</p>
343
- </div></span>
344
-
345
- </li>
346
-
347
-
348
- </ul>
349
-
350
-
351
- <div id="constructor_details" class="method_details_list">
352
- <h2>Constructor Details</h2>
353
-
354
- <div class="method_details first">
355
- <h3 class="signature first" id="initialize-instance_method">
356
-
357
- #<strong>initialize</strong>(password, request_options = {}) &#x21d2; <tt>Boolean</tt>
358
-
359
-
360
-
361
-
362
-
363
- </h3><div class="docstring">
364
- <div class="discussion">
365
-
366
- <p>Creates a new password object.</p>
367
-
368
-
369
- </div>
370
- </div>
371
- <div class="tags">
372
-
373
- <div class="examples">
374
- <p class="tag_title">Examples:</p>
375
-
376
-
377
- <p class="example_title"><div class='inline'>
378
- <p>A simple password with the default request options</p>
379
- </div></p>
380
-
381
- <pre class="example code"><code><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>password</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></code></pre>
382
-
383
-
384
- <p class="example_title"><div class='inline'>
385
- <p>Setting the user agent and the read timeout of the reques</p>
386
- </div></p>
387
-
388
- <pre class="example code"><code><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>password</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>User-Agent</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>My user agent</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:read_timout</span> <span class='op'>=&gt;</span> <span class='int'>10</span><span class='rparen'>)</span></code></pre>
389
-
390
- </div>
391
- <p class="tag_title">Parameters:</p>
392
- <ul class="param">
393
-
394
- <li>
395
-
396
- <span class='name'>password</span>
397
-
398
-
399
- <span class='type'>(<tt>String</tt>)</span>
400
-
401
-
402
-
403
- &mdash;
404
- <div class='inline'>
405
- <p>The password you want to check against the API.</p>
406
- </div>
407
-
408
- </li>
409
-
410
- <li>
411
-
412
- <span class='name'>request_options</span>
413
-
414
-
415
- <span class='type'>(<tt>Hash</tt>)</span>
416
-
417
-
418
- <em class="default">(defaults to: <tt>{}</tt>)</em>
419
-
420
-
421
- &mdash;
422
- <div class='inline'>
423
- <p>Options that can be passed to <code>open</code> when calling the API</p>
424
- </div>
425
-
426
- </li>
427
-
428
- </ul>
429
-
430
-
431
-
432
-
433
-
434
-
435
- <p class="tag_title">Options Hash (<tt>request_options</tt>):</p>
436
- <ul class="option">
437
-
438
- <li>
439
- <span class="name">'User-Agent'</span>
440
- <span class="type">(<tt>String</tt>)</span>
441
- <span class="default">
442
-
443
- &mdash; default:
444
- <tt>&quot;Ruby Pwned::Password #{Pwned::VERSION}&quot;</tt>
445
-
446
- </span>
447
-
448
- &mdash; <div class='inline'>
449
- <p>The user agent used when making an API request.</p>
450
- </div>
451
-
452
- </li>
453
-
454
- </ul>
455
-
456
-
457
- <p class="tag_title">Raises:</p>
458
- <ul class="raise">
459
-
460
- <li>
461
-
462
-
463
- <span class='type'>(<tt>TypeError</tt>)</span>
464
-
465
-
466
-
467
- &mdash;
468
- <div class='inline'>
469
- <p>if the password is not a string.</p>
470
- </div>
471
-
472
- </li>
473
-
474
- </ul>
475
- <p class="tag_title">Since:</p>
476
- <ul class="since">
477
-
478
- <li>
479
-
480
-
481
-
482
-
483
-
484
- <div class='inline'>
485
- <p>1.1.0</p>
486
- </div>
487
-
488
- </li>
489
-
490
- </ul>
491
-
492
- </div><table class="source_code">
493
- <tr>
494
- <td>
495
- <pre class="lines">
496
-
497
-
498
- 54
499
- 55
500
- 56
501
- 57
502
- 58</pre>
503
- </td>
504
- <td>
505
- <pre class="code"><span class="info file"># File 'lib/pwned/password.rb', line 54</span>
506
-
507
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_request_options'>request_options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
508
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>TypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>password must be of type String</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_password'>password</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
509
- <span class='ivar'>@password</span> <span class='op'>=</span> <span class='id identifier rubyid_password'>password</span>
510
- <span class='ivar'>@request_options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#DEFAULT_REQUEST_OPTIONS-constant" title="Pwned::Password::DEFAULT_REQUEST_OPTIONS (constant)">DEFAULT_REQUEST_OPTIONS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_request_options'>request_options</span><span class='rparen'>)</span>
511
- <span class='kw'>end</span></pre>
512
- </td>
513
- </tr>
514
- </table>
515
- </div>
516
-
517
- </div>
518
-
519
- <div id="instance_attr_details" class="attr_details">
520
- <h2>Instance Attribute Details</h2>
521
-
522
-
523
- <span id=""></span>
524
- <div class="method_details first">
525
- <h3 class="signature first" id="password-instance_method">
526
-
527
- #<strong>password</strong> &#x21d2; <tt>String</tt> <span class="extras">(readonly)</span>
528
-
529
-
530
-
531
-
532
-
533
- </h3><div class="docstring">
534
- <div class="discussion">
535
-
536
- <p>Returns the password that is being checked.</p>
537
-
538
-
539
- </div>
540
- </div>
541
- <div class="tags">
542
-
543
- <p class="tag_title">Returns:</p>
544
- <ul class="return">
545
-
546
- <li>
547
-
548
-
549
- <span class='type'>(<tt>String</tt>)</span>
550
-
551
-
552
-
553
- &mdash;
554
- <div class='inline'>
555
- <p>the password that is being checked.</p>
556
- </div>
557
-
558
- </li>
559
-
560
- </ul>
561
- <p class="tag_title">Since:</p>
562
- <ul class="since">
563
-
564
- <li>
565
-
566
-
567
-
568
-
569
-
570
- <div class='inline'>
571
- <p>1.0.0</p>
572
- </div>
573
-
574
- </li>
575
-
576
- </ul>
577
-
578
- </div><table class="source_code">
579
- <tr>
580
- <td>
581
- <pre class="lines">
582
-
583
-
584
- 36
585
- 37
586
- 38</pre>
587
- </td>
588
- <td>
589
- <pre class="code"><span class="info file"># File 'lib/pwned/password.rb', line 36</span>
590
-
591
- <span class='kw'>def</span> <span class='id identifier rubyid_password'>password</span>
592
- <span class='ivar'>@password</span>
593
- <span class='kw'>end</span></pre>
594
- </td>
595
- </tr>
596
- </table>
597
- </div>
598
-
599
- </div>
600
-
601
-
602
- <div id="instance_method_details" class="method_details_list">
603
- <h2>Instance Method Details</h2>
604
-
605
-
606
- <div class="method_details first">
607
- <h3 class="signature first" id="hashed_password-instance_method">
608
-
609
- #<strong>hashed_password</strong> &#x21d2; <tt>String</tt>
610
-
611
-
612
-
613
-
614
-
615
- </h3><div class="docstring">
616
- <div class="discussion">
617
-
618
- <p>Returns the full SHA1 hash of the given password in uppercase.</p>
619
-
620
-
621
- </div>
622
- </div>
623
- <div class="tags">
624
-
625
- <p class="tag_title">Returns:</p>
626
- <ul class="return">
627
-
628
- <li>
629
-
630
-
631
- <span class='type'>(<tt>String</tt>)</span>
632
-
633
-
634
-
635
- &mdash;
636
- <div class='inline'>
637
- <p>The full SHA1 hash of the given password.</p>
638
- </div>
639
-
640
- </li>
641
-
642
- </ul>
643
- <p class="tag_title">Since:</p>
644
- <ul class="since">
645
-
646
- <li>
647
-
648
-
649
-
650
-
651
-
652
- <div class='inline'>
653
- <p>1.0.0</p>
654
- </div>
655
-
656
- </li>
657
-
658
- </ul>
659
-
660
- </div><table class="source_code">
661
- <tr>
662
- <td>
663
- <pre class="lines">
664
-
665
-
666
- 64
667
- 65
668
- 66</pre>
669
- </td>
670
- <td>
671
- <pre class="code"><span class="info file"># File 'lib/pwned/password.rb', line 64</span>
672
-
673
- <span class='kw'>def</span> <span class='id identifier rubyid_hashed_password'>hashed_password</span>
674
- <span class='ivar'>@hashed_password</span> <span class='op'>||=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>SHA1</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span>
675
- <span class='kw'>end</span></pre>
676
- </td>
677
- </tr>
678
- </table>
679
- </div>
680
-
681
- <div class="method_details ">
682
- <h3 class="signature " id="pwned?-instance_method">
683
-
684
- #<strong>pwned?</strong> &#x21d2; <tt>Boolean</tt>
685
-
686
-
687
-
688
-
689
-
690
- </h3><div class="docstring">
691
- <div class="discussion">
692
-
693
- <p>Returns <code>true</code> when the password has been pwned.</p>
694
-
695
-
696
- </div>
697
- </div>
698
- <div class="tags">
699
-
700
- <div class="examples">
701
- <p class="tag_title">Examples:</p>
702
-
703
-
704
- <pre class="example code"><code><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Pwned::Password#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>password</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
705
- <span class='id identifier rubyid_password'>password</span><span class='period'>.</span><span class='id identifier rubyid_pwned?'>pwned?</span> <span class='comment'>#=&gt; true</span></code></pre>
706
-
707
- </div>
708
-
709
- <p class="tag_title">Returns:</p>
710
- <ul class="return">
711
-
712
- <li>
713
-
714
-
715
- <span class='type'>(<tt>Boolean</tt>)</span>
716
-
717
-
718
-
719
- &mdash;
720
- <div class='inline'>
721
- <p><code>true</code> when the password has been pwned.</p>
722
- </div>
723
-
724
- </li>
725
-
726
- </ul>
727
- <p class="tag_title">Raises:</p>
728
- <ul class="raise">
729
-
730
- <li>
731
-
732
-
733
- <span class='type'>(<tt><span class='object_link'><a href="Error.html" title="Pwned::Error (class)">Pwned::Error</a></span></tt>)</span>
734
-
735
-
736
-
737
- &mdash;
738
- <div class='inline'>
739
- <p>if there are errors with the HTTP request.</p>
740
- </div>
741
-
742
- </li>
743
-
744
- <li>
745
-
746
-
747
- <span class='type'>(<tt><span class='object_link'><a href="TimeoutError.html" title="Pwned::TimeoutError (class)">Pwned::TimeoutError</a></span></tt>)</span>
748
-
749
-
750
-
751
- &mdash;
752
- <div class='inline'>
753
- <p>if the HTTP request times out.</p>
754
- </div>
755
-
756
- </li>
757
-
758
- </ul>
759
- <p class="tag_title">Since:</p>
760
- <ul class="since">
761
-
762
- <li>
763
-
764
-
765
-
766
-
767
-
768
- <div class='inline'>
769
- <p>1.0.0</p>
770
- </div>
771
-
772
- </li>
773
-
774
- </ul>
775
-
776
- </div><table class="source_code">
777
- <tr>
778
- <td>
779
- <pre class="lines">
780
-
781
-
782
- 77
783
- 78
784
- 79</pre>
785
- </td>
786
- <td>
787
- <pre class="code"><span class="info file"># File 'lib/pwned/password.rb', line 77</span>
788
-
789
- <span class='kw'>def</span> <span class='id identifier rubyid_pwned?'>pwned?</span>
790
- <span class='id identifier rubyid_pwned_count'>pwned_count</span> <span class='op'>&gt;</span> <span class='int'>0</span>
791
- <span class='kw'>end</span></pre>
792
- </td>
793
- </tr>
794
- </table>
795
- </div>
796
-
797
- <div class="method_details ">
798
- <h3 class="signature " id="pwned_count-instance_method">
799
-
800
- #<strong>pwned_count</strong> &#x21d2; <tt>Integer</tt>
801
-
802
-
803
-
804
-
805
-
806
- </h3><div class="docstring">
807
- <div class="discussion">
808
-
809
- <p>Returns the number of times the password has been pwned.</p>
810
-
811
-
812
- </div>
813
- </div>
814
- <div class="tags">
815
-
816
- <div class="examples">
817
- <p class="tag_title">Examples:</p>
818
-
819
-
820
- <pre class="example code"><code><span class='id identifier rubyid_password'>password</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Pwned.html" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Pwned::Password#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>password</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
821
- <span class='id identifier rubyid_password'>password</span><span class='period'>.</span><span class='id identifier rubyid_pwned_count'>pwned_count</span> <span class='comment'>#=&gt; 3303003</span></code></pre>
822
-
823
- </div>
824
-
825
- <p class="tag_title">Returns:</p>
826
- <ul class="return">
827
-
828
- <li>
829
-
830
-
831
- <span class='type'>(<tt>Integer</tt>)</span>
832
-
833
-
834
-
835
- &mdash;
836
- <div class='inline'>
837
- <p>the number of times the password has been pwned.</p>
838
- </div>
839
-
840
- </li>
841
-
842
- </ul>
843
- <p class="tag_title">Raises:</p>
844
- <ul class="raise">
845
-
846
- <li>
847
-
848
-
849
- <span class='type'>(<tt><span class='object_link'><a href="Error.html" title="Pwned::Error (class)">Pwned::Error</a></span></tt>)</span>
850
-
851
-
852
-
853
- &mdash;
854
- <div class='inline'>
855
- <p>if there are errors with the HTTP request.</p>
856
- </div>
857
-
858
- </li>
859
-
860
- <li>
861
-
862
-
863
- <span class='type'>(<tt><span class='object_link'><a href="TimeoutError.html" title="Pwned::TimeoutError (class)">Pwned::TimeoutError</a></span></tt>)</span>
864
-
865
-
866
-
867
- &mdash;
868
- <div class='inline'>
869
- <p>if the HTTP request times out.</p>
870
- </div>
871
-
872
- </li>
873
-
874
- </ul>
875
- <p class="tag_title">Since:</p>
876
- <ul class="since">
877
-
878
- <li>
879
-
880
-
881
-
882
-
883
-
884
- <div class='inline'>
885
- <p>1.0.0</p>
886
- </div>
887
-
888
- </li>
889
-
890
- </ul>
891
-
892
- </div><table class="source_code">
893
- <tr>
894
- <td>
895
- <pre class="lines">
896
-
897
-
898
- 90
899
- 91
900
- 92</pre>
901
- </td>
902
- <td>
903
- <pre class="code"><span class="info file"># File 'lib/pwned/password.rb', line 90</span>
904
-
905
- <span class='kw'>def</span> <span class='id identifier rubyid_pwned_count'>pwned_count</span>
906
- <span class='ivar'>@pwned_count</span> <span class='op'>||=</span> <span class='id identifier rubyid_fetch_pwned_count'>fetch_pwned_count</span>
907
- <span class='kw'>end</span></pre>
908
- </td>
909
- </tr>
910
- </table>
911
- </div>
912
-
913
- </div>
914
-
915
- </div>
916
-
917
- <div id="footer">
918
- Generated on Wed Mar 14 11:06:58 2018 by
919
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
920
- 0.9.12 (ruby-2.5.0).
921
- </div>
922
-
923
- </div>
924
- </body>
925
- </html>