7 lines
252 B
Python
7 lines
252 B
Python
from typing import Optional
|
|
from uuid import uuid5, UUID, NAMESPACE_DNS
|
|
|
|
def generate_user_uuid5(email: str, shop_id: Optional[int]) -> UUID:
|
|
unique_string = f"{email}-{shop_id}" if shop_id else email
|
|
return uuid5(NAMESPACE_DNS, unique_string)
|