aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-06-03 11:11:35 -0400
committerJack Lloyd <[email protected]>2019-06-03 11:11:35 -0400
commit55562154191077f5bdc71d0ca8714a0f97f2d753 (patch)
treec6104e6065668e26a08e6fe0f9748ba3b1e1894e /src
parent450d5c2bc92663af1ce249a90bdc0f5c5c965a77 (diff)
Add __hash__ for MPI
Diffstat (limited to 'src')
-rwxr-xr-xsrc/python/botan2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/python/botan2.py b/src/python/botan2.py
index b0b2856ec..66e7b9633 100755
--- a/src/python/botan2.py
+++ b/src/python/botan2.py
@@ -1415,6 +1415,9 @@ class MPI(object):
_DLL.botan_mp_cmp(byref(r), self.__obj, other.handle_())
return r.value
+ def __hash__(self):
+ return hash(to_bytes())
+
def __eq__(self, other):
return self.cmp(other) == 0