diff options
Diffstat (limited to 'python/databuffer.py')
| -rw-r--r-- | python/databuffer.py | 6 |
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) |
