(query_char)
| 5 | import hashlib |
| 6 | import sys |
| 7 | def request_api_data(query_char): |
| 8 | url="https://api.pwnedpasswords.com/range/" + query_char |
| 9 | res=requests.get(url) |
| 10 | if res.status_code !=200: |
| 11 | raise RuntimeError(f'Error fetching: {res.status_code}, check the api and try again') |
| 12 | return res |
| 13 | def get_password_leaks_count(hashes, hash_to_check): |
| 14 | hashes=(line.split(':') for line in hashes.text.splitlines()) |
| 15 | for h, count in hashes: |