Files
concrete/hdk/utils/misc.py
Arthur Meyre a2185af578 tests: add test structure and dependencies
- add unique ID generator to hdk and unit test it

refs #15
2021-07-16 12:25:10 +02:00

18 lines
367 B
Python

"""Misc. utils for hdk"""
def get_unique_id():
"""Function to get a unique ID"""
if not hasattr(get_unique_id, "generator"):
def generator():
current_id = 0
while True:
yield current_id
current_id += 1
get_unique_id.generator = generator()
return next(get_unique_id.generator)