import secrets


def gen_uid(size, uid_format=False):
    """Create a random sring."""
    if uid_format:
        token = f"BlinkCamera_{secrets.token_hex(4)}-{secrets.token_hex(2)}-{secrets.token_hex(2)}-{secrets.token_hex(2)}-{secrets.token_hex(6)}"
    else:
        token = secrets.token_hex(size)
    return token