mixed File_Passwd_Unix::generatePassword (string $pass [, string $mode = 'md5' [, string $salt = null]])
mixed File_Passwd_Unix::generatePassword
Generate a "Un*x" style password.
The encryption mode can be of any type File_Passwd provides, although FILE_PASSWD_MD5 and FILE_PASSWD_DES are the most common.
the plaintext password to encrypt
the encryption mode to use
the salt to use for encryption (usually empty)
Returns string encrypted password, or PEAR_Error FILE_PASSWD_E_INVALID_ENC_MODE if encryption mode is not supported.
Example 37-1. File_Passwd_Unix::generatePassword()
require_once 'File/Passwd/Unix.php'; $pass = File_Passwd_Unix::generatePassword('secret', FILE_PASSWD_MD5);
This function should be called statically.