hash: remove time from hash, now title only

This commit is contained in:
A.M. Rowsell 2026-04-13 15:26:35 -04:00
commit 02aa1aa11b
Signed by: amr
GPG key ID: E0879EDBDB0CA7B1
2 changed files with 178 additions and 3 deletions

View file

@ -91,12 +91,12 @@ class Discorss:
"Feed %s doesn't supply a published time, using updated time instead",
hook["name"],
)
# Hash the title and time of the latest post and use that to determine if it's been posted
# Hash the title of the latest post and use that to determine if it's been posted
# Yes, SHA3-512 is totally unnecessary for this purpose, but I love SHA3
self.logger.debug("About to hash %s ...", latest_post["title"])
try:
new_hash = hashlib.sha3_512(
bytes(latest_post["title"] + str(latest_post_time), "utf-8")
bytes(latest_post["title"], "utf-8") # Removed time from hash
).hexdigest()
except TypeError:
self.logger.error("Title of %s isn't hashing correctly", hook["name"])