mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
11 lines
301 B
Python
11 lines
301 B
Python
import random
|
|
import string
|
|
|
|
def stringGen(len: int = 63) -> str:
|
|
"""Generate a random string of lowercase letters and digits."""
|
|
|
|
charset = string.ascii_lowercase + string.digits
|
|
result = []
|
|
for _ in range(len):
|
|
result.append(random.choice(charset))
|
|
return ''.join(result) |