function CryptTest::providerTestHashBase64
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::providerTestHashBase64()
- 8.9.x core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::providerTestHashBase64()
- 10 core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::providerTestHashBase64()
Provides data for self::testHashBase64().
Return value
array Test data.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ CryptTest.php, line 74
Class
- CryptTest
- Tests random byte generation.
Namespace
Drupal\Tests\Component\UtilityCode
public static function providerTestHashBase64() {
return [
[
'data' => 'The SHA (Secure Hash Algorithm) is one of a number of cryptographic hash functions. A cryptographic hash is like a signature for a text or a data file. SHA-256 algorithm generates an almost-unique, fixed size 256-bit (32-byte) hash. Hash is a one way function – it cannot be decrypted back. This makes it suitable for password validation, challenge hash authentication, anti-tamper, digital signatures.',
// cspell:disable-next-line
'expected_hash' => '034rT6smZAVRxpq8O98cFFNLIVx_Ph1EwLZQKcmRR_s',
],
[
'data' => 'SHA-256 is one of the successor hash functions to SHA-1, and is one of the strongest hash functions available.',
// cspell:disable-next-line
'expected_hash' => 'yuqkDDYqprL71k4xIb6K6D7n76xldO4jseRhEkEE6SI',
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.