18 lines
319 B
Python
18 lines
319 B
Python
from uuid import UUID
|
|
|
|
import shortuuid
|
|
|
|
|
|
def encode_uuid(uuid_value: UUID) -> str:
|
|
"""
|
|
Return short id string from an UUID
|
|
"""
|
|
return shortuuid.encode(uuid_value)
|
|
|
|
|
|
def decode_short_id(short_id: str) -> UUID:
|
|
"""
|
|
Return UUID from a short id string
|
|
"""
|
|
return shortuuid.decode(short_id)
|