def determine_header_length(trf_contents: bytes) -> int:
    """Returns the header length of a TRF file

    Determined through brute force reverse engineering only. Not based
    upon official documentation.

    Parameters
    ----------
    trf_contents : bytes

    Returns
    -------
    header_length : int
        The length of the TRF header, prior to the table portion of the
        TRF file.
    """

    column_end = b"\t\xdc\x00\xe8\t\xdc\x00\xe9\t\xdc\x00\xea\t\xdc\x00\xeb\t\xdc\x00"
    header_length = trf_contents.index(column_end) + len(column_end)

    # test = trf_contents.split(b"\t")
    # row_skips = 6
    # i = next(i for i, item in enumerate(test[row_skips::]) if len(item) > 3) + row_skips
    # header_length_old_method = len(b"\t".join(test[0:i])) + 3

    # if header_length_old_method != header_length:
    #     raise ValueError("Inconsistent header length determination")

    return header_length