def METHOD_NAME(major_tag, length):
    if length < 24:
        return struct.pack(">B", major_tag | length)
    elif length < 256:
        return struct.pack(">BB", major_tag | 24, length)
    elif length < 65536:
        return struct.pack(">BH", major_tag | 25, length)
    elif length < 4294967296:
        return struct.pack(">BL", major_tag | 26, length)
    else:
        return struct.pack(">BQ", major_tag | 27, length)