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 #####
评论列表
文章目录