aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-10-14 21:15:10 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit300845598e26b0441afcd719a5b9e3af3e3aa45b (patch)
tree7724bd1a5065dd9e8adc4e046079a4350be0ba92
parent7133c6c34c38180fdeda18e38e6ae0548112ac01 (diff)
downloadwee-slack-300845598e26b0441afcd719a5b9e3af3e3aa45b.tar.gz
Only use letters for message hashes
This way it doesn't collide with message indices.
-rw-r--r--slack/slack_conversation.py4
1 files changed, 3 insertions, 1 deletions
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]):