PHP crypt() Function

The crypt () function in PHP returns a hashed string using DES, Blowfish, or MD5 algorithms.

Some constants of crypt() function are as follows:

  1. [CRYPT_STD_DES]
  2. [CRYPT_EXT_DES]
  3. [CRYPT_MD5]
  4. [CRYPT_BLOWFISH]
  5. [CRYPT_SHA_256]
  6. [CRYPT_SHA_512] etc.

Syntax

Parameter

str(required)- This parameter represents the string to be hashed

salt(optional)- This parameter represents the salt string to base the hashing on.

Return

This function returns the hashed string or a string that is shorter than 13 characters.

Example 1

Output

Example 2

Output

Example 3

Output

Example 4

Output

Example 5

Output

Pin It on Pinterest

Share This