Patchwork D7848: hashutil: new package for hashing-related features

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2020, 4:39 a.m.
Message ID <ce3387f14106f445a5f1a87381df57e5@localhost.localdomain>
Download mbox | patch
Permalink /patch/44303/
State Not Applicable
Headers show

Comments

phabricator - Jan. 14, 2020, 4:39 a.m.
Closed by commit rHG0803f803ba03: hashutil: new package for hashing-related features (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7848?vs=19189&id=19199

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7848/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7848

AFFECTED FILES
  mercurial/utils/hashutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/utils/hashutil.py b/mercurial/utils/hashutil.py
new file mode 100644
--- /dev/null
+++ b/mercurial/utils/hashutil.py
@@ -0,0 +1,9 @@ 
+from __future__ import absolute_import
+
+import hashlib
+
+try:
+    from mercurial.thirdparty import sha1dc
+    sha1 = sha1dc.sha1
+except (ImportError, AttributeError):
+    sha1 = hashlib.sha1