Hashing is one of the most important aspects of modern-day programming. In terms of data security and privacy, hashing plays a key role in computer cryptography. We do not feel comfortable to keep our data unsafe and open for all. PHP has several built-in hashing functions. Let's quickly go through them:
- md5: This calculates the md5 hash of a given string. It will generate 32 characters unique hash for each of the provided string. Hashing is one way, which means, there is no function to decrypt the hashed string to actual string.
- sha1: This function calculates the sha1 hash of a given string. The generated hash is 40 characters in length. Like md5, sha1 is also a one way hashing. If we set the second parameter to be true, then the function will produce 20-character raw output hash string. One thing to remember is sha1, sha256, and md5 are not secure enough to use...