Hashing

  • Hashing creates a digest out of large chunk of data. As long as the data is same, the digest created is same. Uniqueness of the digest created depends on the hash function being used.
  • Example of hash functions – MD5, SHA1, SHA256. Example implementations in Java
    • JDK – java.security.MessageDigest (Link).
    • Apache Codec – org.apache.commons.codec.digest.DigestUtils (Link)
    • Google guava – com.google.common.hash (Link)
  • Hash collision happens when the hash digest is same for 2 entries. Hash collisions are usually handled through approaches such as hash chaining or open addressing.
  • Hash based data structures are heavily used in typical Java based implementations.

 

Leave a Reply

Your email address will not be published. Required fields are marked *