MCPcopy Create free account
hub / github.com/AdarshAddee/Hacktoberfest2022_for_Beginers / request_api_data

Function request_api_data

Python/checkpass.py:7–12  ·  view source on GitHub ↗
(query_char)

Source from the content-addressed store, hash-verified

5import hashlib
6import sys
7def 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
13def get_password_leaks_count(hashes, hash_to_check):
14 hashes=(line.split(':') for line in hashes.text.splitlines())
15 for h, count in hashes:

Callers 1

pwned_api_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected