Skip to content

Commit 7097538

Browse files
committed
Add api for database.KeyValueStore.get_value_hash
1 parent 9532724 commit 7097538

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

python/database.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def set_value(self, key: str, value: databuffer.DataBuffer):
7777
"""Set the value for a single key"""
7878
core.BNSetKeyValueStoreBuffer(self.handle, key, value.handle)
7979

80+
def get_value_hash(self, key: str) -> databuffer.DataBuffer:
81+
"""Get the hash of the value for a single key (hash function not specified)"""
82+
handle = core.BNGetKeyValueStoreValueHash(self.handle, key)
83+
assert handle is not None
84+
return databuffer.DataBuffer(handle=handle)
85+
8086
@property
8187
def serialized_data(self) -> databuffer.DataBuffer:
8288
"""Get the stored representation of the kvs (read-only)"""

0 commit comments

Comments
 (0)