Generate a random object ID.
(length: int = 17)
| 19 | |
| 20 | |
| 21 | def crypto_random_object_id(length: int = 17) -> str: |
| 22 | """Generate a random object ID.""" |
| 23 | chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' |
| 24 | return ''.join(secrets.choice(chars) for _ in range(length)) |
no outgoing calls