public function encrypt($password, $salt = null, $member = null)
 {
     $password = parent::encrypt($password, $salt, $member);
     // Legacy fix: This shortening logic is producing unpredictable results.
     //
     // Convert the base of the hexadecimal password to 36 to make it shorter
     // In that way we can store also a SHA256 encrypted password in just 64
     // letters.
     return substr(base_convert($password, 16, 36), 0, 64);
 }
 public function testValidateAutoLoginToken()
 {
     $enc = new PasswordEncryptor_PHPHash('sha1');
     $m1 = new Member();
     $m1->PasswordEncryption = 'sha1';
     $m1->Salt = $enc->salt('123');
     $m1Token = $m1->generateAutologinTokenAndStoreHash();
     $m2 = new Member();
     $m2->PasswordEncryption = 'sha1';
     $m2->Salt = $enc->salt('456');
     $m2Token = $m2->generateAutologinTokenAndStoreHash();
     $this->assertTrue($m1->validateAutoLoginToken($m1Token), 'Passes token validity test against matching member.');
     $this->assertFalse($m2->validateAutoLoginToken($m1Token), 'Fails token validity test against other member.');
 }