Closed rijenkii closed 2 years ago
For my purposes using shortuuid.encode(uuid.uuid4())
instead of shortuuid.random()
is a good enough workaround:
>>> import uuid4
>>> import shortuuid
>>> while True: shortuuid.encode(uuid.uuid4())
'eYq2rLsdXUoYcnrQWLYQv4'
'oDyDQErXN5see3HTsHePfe'
'VwS9TAacmGkXMvL3e4ig8d'
'nvkdW43JoKF3tLvyrhgNvM'
'CdejV2s7x7fByFhYYMZewY'
'BRECgehLNSaTo4uLrApwzu'
'aLU56dd9YS7MDkpTbQmdYX'
...
Yes, random data isn't a valid UUID and thus can't be decoded. If you need a UUID, you should use shortuuid.uuid()
instead.
Repro: