Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hash Table 5
# @params {string} key
# @returns {number}
def hash(self, key):
k = 0
for s in list(md5(str(key).encode('utf-8')).hexdigest()):
k += ord(s)
return k % len(self.buckets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.