Skip to content

Commit

Permalink
Removed usage of MD5 from calc_label_from_name (#2062)
Browse files Browse the repository at this point in the history
Removed usage of MD5 from calc_label_from_name
  • Loading branch information
Zac-HD committed Jul 28, 2019
2 parents 0cc3c1d + d38a4c8 commit 549fe13
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ their individual contributions.

* `Adam Johnson <https://github.com/adamchainz>`_
* `Adam Sven Johnson <https://www.github.com/pkqk>`_
* `Alex Gaynor <https://github.com/alex>`_
* `Alex Stapleton <https://www.github.com/public>`_
* `Alex Willmer <https://github.com/moreati>`_ (alex@moreati.org.uk)
* `Ben Peterson <https://github.com/killthrush>`_ (killthrush@hotmail.com)
Expand Down
6 changes: 6 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
RELEASE_TYPE: patch

This patch changes an internal use of MD5 to SHA hashes, to better support
users subject to FIPS-140. There is no user-visible or API change.

Thanks to Alex Gaynor for this patch.
2 changes: 1 addition & 1 deletion hypothesis-python/docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ cause errors on Python 3 due to internal rounding.
-------------------

Hypothesis now seeds and resets the global state of
:class:`np.random <numpy:numpy.random.RandomState>` for each
:mod:`np.random <numpy:numpy.random>` for each
test case, to ensure that tests are reproducible.

This matches and complements the existing handling of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


def calc_label_from_name(name):
hashed = hashlib.md5(str_to_bytes(name)).digest()
hashed = hashlib.sha384(str_to_bytes(name)).digest()
return int_from_bytes(hashed[:8])


Expand Down

0 comments on commit 549fe13

Please sign in to comment.