Skip to content

Instantly share code, notes, and snippets.

@gaxiiiiiiiiiiii
Last active November 1, 2018 07:09
Show Gist options
  • Save gaxiiiiiiiiiiii/6c1d49c0e01da5b0dd155780690db63c to your computer and use it in GitHub Desktop.
Save gaxiiiiiiiiiiii/6c1d49c0e01da5b0dd155780690db63c to your computer and use it in GitHub Desktop.
def search(self, data):
target = None
hash_value = sha256(data.encode()).hexdigest()
for node in self.leaves:
if node.hash == hash_value:
target = node
return target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment