What Is Hashing
What Is Hashing
Components of Hashing
There are majorly three components of hashing:
1. Key: A Key can be anything string or integer which is fed as input in
the hash function the technique that determines an index or location for
storage of an item in a data structure.
2. Hash Function: The hash function receives the input key and returns
the index of an element in an array called a hash table. The index is
known as the hash index.
3. Hash Table: Hash table is a data structure that maps keys to values
using a special function called a hash function. Hash stores the data in
an associative manner in an array where each data value has its own
unique index.
import hashlib
"""
"""
hash_object = hashlib.new(algorithm)
hash_object.update(input_string.encode('utf-8'))
return hash_object.hexdigest()
def main():
if __name__ == "__main__":
main()