#!/usr/bin/python3 import mmh3 import requests import argparse import codecs requests.packages.urllib3.disable_warnings() parser = argparse.ArgumentParser(description='Process a favicon.ico and calculate its hash') parser.add_argument('url', help='The URL path to favicon.ico') args = parser.parse_args() response = requests.get(args.url, verify=False, timeout=5) favicon = codecs.encode(response.content, "base64") hash = mmh3.hash(favicon) print(hash) # python3 favicon-hash.py http://site.com/img/favicon.ico