17 lines
360 B
PHP
17 lines
360 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Pdahal\Xmpp\AuthTypes;
|
||
|
|
||
|
class DigestMD5 extends Authentication
|
||
|
{
|
||
|
protected string $name = 'DIGEST-MD5';
|
||
|
|
||
|
public function encodedCredentials(): string
|
||
|
{
|
||
|
$credentials = "\x00{$this->options->getUsername()}\x00{$this->options->getPassword()}";
|
||
|
return self::quote(sha1($credentials));
|
||
|
}
|
||
|
}
|