Home Assistant Unofficial Reference 2024.12.1
uuid.py
Go to the documentation of this file.
1 """Helpers to generate uuids."""
2 
3 from random import getrandbits
4 
5 
6 def random_uuid_hex() -> str:
7  """Generate a random UUID hex.
8 
9  This uuid should not be used for cryptographically secure
10  operations.
11  """
12  return f"{getrandbits(32 * 4):032x}"
str random_uuid_hex()
Definition: uuid.py:6