mirror of
https://github.com/adulau/HHHash.git
synced 2024-12-22 16:56:03 +00:00
18 lines
383 B
Python
18 lines
383 B
Python
|
import requests
|
||
|
import hashlib
|
||
|
|
||
|
|
||
|
def buildhash(url=None, debug=False):
|
||
|
if url is None:
|
||
|
return False
|
||
|
r = requests.get(url)
|
||
|
hhhash = ""
|
||
|
for header in r.headers.keys():
|
||
|
hhhash = f"{hhhash}:{header}"
|
||
|
m = hashlib.sha256()
|
||
|
if debug:
|
||
|
print(hhhash[1:])
|
||
|
m.update(hhhash[1:].encode())
|
||
|
digest = m.hexdigest()
|
||
|
return f"hhh:1:{digest}"
|