|
static | hash ($algorithm, $data, $binaryOutput=false) |
|
Definition at line 28 of file Crypt.php.
◆ _detectHashSupport()
static _detectHashSupport |
( |
|
$algorithm | ) |
|
|
staticprotected |
- Parameters
-
- Exceptions
-
- See also
- Zend_Crypt_Exception
Definition at line 97 of file Crypt.php.
101 if (in_array($algorithm, hash_algos())) {
107 if (in_array($algorithm, self::$_supportedAlgosMhash)) {
112 if ($algorithm ==
'ripemd160') {
113 $algorithm =
'rmd160';
116 if (in_array($algorithm, self::$_supportedAlgosOpenssl)) {
123 #require_once 'Zend/Crypt/Exception.php'; 124 throw new Zend_Crypt_Exception(
'\'' . $algorithm .
'\' is not supported by any available extension or native
function');
◆ _digestHash()
static _digestHash |
( |
|
$algorithm, |
|
|
|
$data, |
|
|
|
$binaryOutput |
|
) |
| |
|
staticprotected |
- Parameters
-
string | $algorithm | |
string | $data | |
bool | $binaryOutput | |
- Returns
- string
Definition at line 133 of file Crypt.php.
135 return hash($algorithm,
$data, $binaryOutput);
static hash($algorithm, $data, $binaryOutput=false)
◆ _digestMhash()
static _digestMhash |
( |
|
$algorithm, |
|
|
|
$data, |
|
|
|
$binaryOutput |
|
) |
| |
|
staticprotected |
- Parameters
-
string | $algorithm | |
string | $data | |
bool | $binaryOutput | |
- Returns
- string
Definition at line 144 of file Crypt.php.
146 $constant = constant(
'MHASH_' . strtoupper($algorithm));
147 $binary = mhash($constant,
$data);
151 return bin2hex($binary);
◆ _digestOpenssl()
static _digestOpenssl |
( |
|
$algorithm, |
|
|
|
$data, |
|
|
|
$binaryOutput |
|
) |
| |
|
staticprotected |
- Parameters
-
string | $algorithm | |
string | $data | |
bool | $binaryOutput | |
- Returns
- string
Definition at line 160 of file Crypt.php.
162 if ($algorithm ==
'ripemd160') {
163 $algorithm =
'rmd160';
165 return openssl_digest(
$data, $algorithm, $binaryOutput);
◆ hash()
static hash |
( |
|
$algorithm, |
|
|
|
$data, |
|
|
|
$binaryOutput = false |
|
) |
| |
|
static |
- Parameters
-
string | $algorithm | |
string | $data | |
bool | $binaryOutput | |
- Returns
- unknown
Definition at line 81 of file Crypt.php.
83 $algorithm = strtolower($algorithm);
85 return $algorithm(
$data, $binaryOutput);
88 $supportedMethod =
'_digest' . ucfirst(self::$_type);
89 $result = self::$supportedMethod($algorithm,
$data, $binaryOutput);
static _detectHashSupport($algorithm)
◆ $_supportedAlgosMhash
Initial value:= array(
'adler32',
'crc32',
'crc32b',
'gost',
'haval128',
'haval160',
'haval192',
'haval256',
'md4',
'md5',
'ripemd160',
'sha1',
'sha256',
'tiger',
'tiger128',
'tiger160'
)
Definition at line 56 of file Crypt.php.
◆ $_supportedAlgosOpenssl
Initial value:= array(
'md2',
'md4',
'mdc2',
'rmd160',
'sha',
'sha1',
'sha224',
'sha256',
'sha384',
'sha512'
)
Definition at line 40 of file Crypt.php.
◆ $_type
◆ TYPE_HASH
◆ TYPE_MHASH
const TYPE_MHASH = 'mhash' |
◆ TYPE_OPENSSL
const TYPE_OPENSSL = 'openssl' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Crypt.php