mixed File_Passwd_Authbasic::generatePassword (
string $pass
, string $mode = 'des'
, string $salt = null
)
Generate a password usable for "AuthBasic" authentication.
The encryption mode can either be FILE_PASSWD_DES, FILE_PASSWD_SHA or FILE_PASSWD_MD5.
$pass
the plaintext password to encrypt
$mode
the encryption mode to use
$salt
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.
File_Passwd_Authbasic::generatePassword()
<?php
require_once 'File/Passwd/Authbasic.php';
$pass = File_Passwd_Authbasic::generatePassword('secret', FILE_PASSWD_MD5);
?>
This function should be called statically.