Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Nov 18, 2024
1 parent d4715e0 commit 65a8518
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ Example code

# HashTableNT mapping 256bit key [bytes] --> Chunk value [namedtuple]
Chunk = namedtuple("Chunk", ["refcount", "size"])
ChunkFormat = namedtuple("ChunkFormat", ["refcount", "size"])
chunk_format = ChunkFormat(refcount="I", size="I")

# 256bit (32Byte) key, 2x 32bit (4Byte) values
ht = HashTableNT(key_size=32, value_format="<II", value_type=Chunk)
ht = HashTableNT(key_size=32, value_type=Chunk, value_format=chunk_format)

key = b"x" * 32 # the key is usually from a cryptographic hash fn
value = Chunk(refcount=1, size=42)
Expand Down

0 comments on commit 65a8518

Please sign in to comment.