From 300845598e26b0441afcd719a5b9e3af3e3aa45b Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 14 Oct 2023 21:15:10 +0200 Subject: Only use letters for message hashes This way it doesn't collide with message indices. --- slack/slack_conversation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'slack') diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index c1db29e..652c8f2 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -48,7 +48,9 @@ def sha1_hex(string: str) -> str: def hash_from_ts(ts: SlackTs) -> str: - return sha1_hex(str(ts)) + hex_str = sha1_hex(str(ts)) + only_letters = hex_str.translate(str.maketrans("0123456789", "ghijklmnop")) + return only_letters class SlackConversationMessageHashes(Dict[SlackTs, str]): -- cgit