Skip to content

Commit

Permalink
docs: it's ok that we use MD5
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jun 16, 2024
1 parent 827ce55 commit d604138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coverage/lcovreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

def line_hash(line: str) -> str:
"""Produce a hash of a source line for use in the LCOV file."""
# The LCOV file format requires MD5 as a fingerprint of the file. This is
# not a security use. Some security scanners raise alarms about the use of
# MD5 here, but it is a false positive. This is not a security concernt.
hashed = hashlib.md5(line.encode("utf-8")).digest()
return base64.b64encode(hashed).decode("ascii").rstrip("=")

Expand Down

0 comments on commit d604138

Please sign in to comment.