This is a simple script that is used to calculate the hash of any favicon, whether it is online or locally, and returns the string to be supplied to shodan to search using favicons, very useful in cases of searches on domains (for example behind Cloudflare).
it's just a script used as an exercise, feel free to modify it as you like and improve it, perhaps sharing the improvements.