mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
12 lines
334 B
Python
12 lines
334 B
Python
import random
|
|
from unicodedata import normalize
|
|
|
|
|
|
# Return a random string of 6 letter/digits.
|
|
def random_token(length=6) -> str:
|
|
return "".join(
|
|
[random.choice('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') for x in range(length)])
|
|
|
|
|
|
def normalize_utf(username):
|
|
return normalize('NFKC', username)
|