Mathematical function that maps arbitrarily-sized data to fixed-size integers, often used as keys in hash tables or to help ensure data integrity
A hash function maps data structures of any size to fixed-length integers, with the intent that different data map to different integers. Some important kinds of hash functions are
- hash-tables, where the hash is a small integer used as an array index for fast data lookup;
- checksums used to verify the integrity of data that may be subject to accidental errors;
- cryptographic hash functions in cryptography, where the hash reveals no information about the data.