File_Passwd_Unix::generatePassword()

File_Passwd_Unix::generatePassword() -- Generate password

Referentiesamenvatting

mixed File_Passwd_Unix::generatePassword (string $pass [, string $mode = 'md5' [, string $salt = null]])

Beschrijving

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.

Parameter

string $pass

the plaintext password to encrypt

string $mode

the encryption mode to use

string $salt

the salt to use for encryption (usually empty)

Return waarde

Returns string encrypted password, or PEAR_Error FILE_PASSWD_E_INVALID_ENC_MODE if encryption mode is not supported.

Voorbeeld

Note

Deze functie zou statisch moeten worden aangeroepen.