function CryptTest::testHashBase64
Tests hash generation.
@dataProvider providerTestHashBase64
@covers ::hashBase64
      
    
Parameters
string $data: Data to hash.
string $expected_hash: Expected result from hashing $data.
File
- 
              core/
tests/ Drupal/ Tests/ Component/ Utility/ CryptTest.php, line 28  
Class
- CryptTest
 - Tests random byte generation.
 
Namespace
Drupal\Tests\Component\UtilityCode
public function testHashBase64($data, $expected_hash) {
  $hash = Crypt::hashBase64($data);
  $this->assertEquals($expected_hash, $hash, 'The correct hash was not calculated.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.