Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: abp/filters/renderer.py

Issue 29851654: Issue 6850 - Remove generation of checksums (Closed) Base URL: https://hg.adblockplus.org/python-abp/
Patch Set: Remove checksum documentation from the README Created Aug. 9, 2018, 10:05 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: abp/filters/renderer.py
===================================================================
--- a/abp/filters/renderer.py
+++ b/abp/filters/renderer.py
@@ -17,8 +17,6 @@
from __future__ import unicode_literals
-import base64
-import hashlib
import itertools
import logging
import time
@@ -139,23 +137,6 @@
yield line
-def _insert_checksum(lines):
- """Add checksum to the filter list.
-
- See https://adblockplus.org/filters#special-comments for description
- of the checksum algorithm.
- """
- md5sum = hashlib.md5()
-
- for line in lines:
- if line.type != 'emptyline':
- md5sum.update(line.to_string().encode('utf-8') + b'\n')
- yield line
-
- checksum = base64.b64encode(md5sum.digest()).rstrip(b'=')
- yield Metadata('Checksum', checksum.decode('utf-8'))
-
-
def _validate(lines):
"""Validate the final list."""
first_line, rest = _first_and_rest(lines)
@@ -196,6 +177,6 @@
lines, default_source = _get_and_parse_fragment(name, sources, top_source)
lines = _process_includes(sources, default_source, [name], lines)
for proc in [_process_timestamps, _insert_version, _remove_duplicates,
- _insert_checksum, _validate]:
+ _validate]:
lines = proc(lines)
return lines
« README.md ('K') | « abp/filters/parser.py ('k') | tests/test_render_script.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld