UTscapy.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:trex-http-proxy 作者: alwye 项目源码 文件源码
def compute_campaign_digests(test_campaign):
    dc = b""
    for ts in test_campaign:
        dts = b""
        for t in ts:
            dt = t.test.strip().encode('ascii')
            t.crc = crc32(dt)
            dts += b"\0"+dt
        ts.crc = crc32(dts)
        dc += b"\0\x01"+dts
    test_campaign.crc = crc32(dc)
    if type(test_campaign.filename) is str and test_campaign.filename != '<stdin>':
      test = open(test_campaign.filename, 'rb').read()
    elif test_campaign.filename == '<stdin>':
      test = sys.stdin.read().encode('ascii')
    else:
      raise Exception("Unknown test source %s" % test_campaign.filename)
    test_campaign.sha = sha1(test)


#### FILTER CAMPAIGN #####
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号