import secrets


def create_entity_id(num_bytes: int):
    """Generate a random, secure string of the given length _in bytes_ (not
    chars).

    Example output with 16 bytes:
    "0hBJj83LDfPs0VlhMhkGuw"

    Example output with 32 bytes:
    "l9qR1wvRiM6HfS86gBV79EM9Plb5Z0s8eshFXo6nHhs"
    """
    return secrets.token_urlsafe(num_bytes)