mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 16:10:40 +05:30
18 lines
471 B
PHP
18 lines
471 B
PHP
|
<?php
|
||
|
namespace common\components\oauth\Util\KeyAlgorithm;
|
||
|
|
||
|
use League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm;
|
||
|
use League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface;
|
||
|
use Ramsey\Uuid\Uuid;
|
||
|
|
||
|
class UuidAlgorithm extends DefaultAlgorithm implements KeyAlgorithmInterface {
|
||
|
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function generate($len = 40) : string {
|
||
|
return Uuid::uuid5(Uuid::NAMESPACE_DNS, parent::generate($len))->toString();
|
||
|
}
|
||
|
|
||
|
}
|