Hash Tables are said to be the fastest/best way of Storing/Retrieving data.
My understanding of a hash table, hashing is as follows (Please correct me if I am wrong or Please add If there is anything more):
- A Hash Table is nothing but an array (single or multi-dimensional) to store values.
- Hashing is the process to find the index/location in the array to insert/retrieve the data. You take a data item(s) and pass it as a key(s) to a hash function and you would get the index/location where to insert/retrieve the data.
I have a question:
Is the hash function used to store/retrieve the data DIFFERENT from a cryptographic hash function used in security applications for authentication like MD5, HMAC, SHA-1 etc...?
In what way(s) are they different?
- How to write a hash function in C?
- Is there some standard or guidelines to it?
- How do we ensure that the output of a hash function i.e, index is not out of range?
It would be great if you could mention some good links to understand these better.