The code already appears to exist for Discourse
but more importantly, this is implemented elsewhere, and Gravatar and Libravatar explicitly support it well.
For instance, here’s a document I made about Libravatar’s support
https://gitlab.com/-/snippets/2590066/raw/main/s0s2gl.txt.md
-
APIs
email = ''.encode('utf-8')
hash = hashlib.md5(email.strip().lower()).hexdigest()
print(hash)
-
Examples