def did(tag_class, is_constructed, tag_id):
    """
    Calculate decoder_id as <tag id > | tag_class | constructed
    :param tag_class:
    :param is_constructed:
    :param tag_id:
    :return:
    """
    did = tag_class >> 5
    if is_constructed:
        did |= 1
    return did | (tag_id << 3)