Skip to content

Commit

Permalink
Macro for different type instances
Browse files Browse the repository at this point in the history
  • Loading branch information
automainint committed Apr 9, 2024
1 parent 9216f32 commit 701d506
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 194 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ Python program to use the library with SipHash and 1-byte symbols:
import riblt_rust_py as riblt

symbol_size = 1
key_0 = 123
key_1 = 456
key = bytes([16, 15, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2, 1])

enc = riblt.new_encoder_sip(symbol_size, key_0, key_1)
enc = riblt.new_encoder_sip(symbol_size, key)

enc.add_symbol(bytes([1]))
enc.add_symbol(bytes([2]))
enc.add_symbol(bytes([4]))

dec = riblt.new_decoder_sip(symbol_size, key_0, key_1)
dec = riblt.new_decoder_sip(symbol_size, key)

dec.add_symbol(bytes([1]))
dec.add_symbol(bytes([3]))
Expand Down
7 changes: 3 additions & 4 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

def example():
symbol_size = 1
key_0 = 123
key_1 = 456
key = bytes([16, 15, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2, 1])

enc = riblt.new_encoder_sip(symbol_size, key_0, key_1)
enc = riblt.new_encoder_sip(symbol_size, key)

enc.add_symbol(bytes([1]))
enc.add_symbol(bytes([2]))
enc.add_symbol(bytes([4]))

dec = riblt.new_decoder_sip(symbol_size, key_0, key_1)
dec = riblt.new_decoder_sip(symbol_size, key)

dec.add_symbol(bytes([1]))
dec.add_symbol(bytes([3]))
Expand Down
Loading

0 comments on commit 701d506

Please sign in to comment.