Some checks failed
CI / test (push) Failing after 20s
- add chats.public_id random identifier with migration 0011
- expose public_id in chat API payloads
- use chat public_id in message search UI label
- fix users router order so /users/blocked no longer conflicts with /users/{user_id}
10 lines
200 B
Python
10 lines
200 B
Python
import secrets
|
|
import string
|
|
|
|
|
|
_ALPHABET = string.ascii_letters + string.digits
|
|
|
|
|
|
def generate_public_id(length: int = 12) -> str:
|
|
return "".join(secrets.choice(_ALPHABET) for _ in range(length))
|