summaryrefslogtreecommitdiff
path: root/python/databuffer.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-10-15 14:16:06 -0400
committerGlenn Smith <glenn@vector35.com>2021-10-15 17:52:27 -0400
commit139520e51c3b7f8c3fd5c4c553dd13e12ffd744d (patch)
tree5d064f2d077cda44ea082f6249efe085cf38b59f /python/databuffer.py
parente6ca3a951901ff7167c518d6fa52c0d4311b893a (diff)
Database python api
Diffstat (limited to 'python/databuffer.py')
-rw-r--r--python/databuffer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/databuffer.py b/python/databuffer.py
index baf35b17..cc40c5ad 100644
--- a/python/databuffer.py
+++ b/python/databuffer.py
@@ -129,6 +129,12 @@ class DataBuffer:
ctypes.memmove(buf, data, len(self))
return buf.raw
+ def __eq__(self, other: 'DataBuffer') -> bool:
+ # Not cryptographically secure
+ if len(self) != len(other):
+ return False
+ return bytes(self) == bytes(other)
+
def escape(self) -> str:
return core.BNDataBufferToEscapedString(self.handle)