MCPcopy Create free account
hub / github.com/ElementsProject/elements / insert

Method insert

test/functional/test_framework/muhash.py:79–82  ·  view source on GitHub ↗

Insert a byte array data in the set.

(self, data)

Source from the content-addressed store, hash-verified

77 self.denominator = 1
78
79 def insert(self, data):
80 """Insert a byte array data in the set."""
81 data_hash = hashlib.sha256(data).digest()
82 self.numerator = (self.numerator * data_to_num3072(data_hash)) % self.MODULUS
83
84 def remove(self, data):
85 """Remove a byte array from the set."""

Callers 5

test_muhashMethod · 0.95
setUpMethod · 0.45
run_testMethod · 0.45

Calls 2

data_to_num3072Function · 0.85
digestMethod · 0.80

Tested by 3

test_muhashMethod · 0.76
setUpMethod · 0.36