def check_hexstring(opt):
    """
    Return the calculated CRC sum of a hex string.
    """
    if opt.undefined_crc_parameters:
        sys.stderr.write("{0:s}: error: undefined parameters\n".format(sys.argv[0]))
        sys.exit(1)
    if len(opt.check_string) % 2 != 0:
        opt.check_string = "0" + opt.check_string
    if sys.version_info >= (3, 0):
        opt.check_string = bytes(opt.check_string, 'utf_8')
    try:
        check_str = bytearray(binascii.unhexlify(opt.check_string))
    except __HOLE__:
        sys.stderr.write(
            "{0:s}: error: invalid hex string {1:s}\n".format(sys.argv[0], opt.check_string))
        sys.exit(1)

    opt.check_string = check_str
    return check_string(opt)


# function crc_file_update
###############################################################################
dataset/ETHPy150Open tpircher/pycrc/pycrc.py/check_hexstring