hash: remove time from hash, now title only
This commit is contained in:
parent
c385b3266c
commit
02aa1aa11b
2 changed files with 178 additions and 3 deletions
|
|
@ -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"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue