Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Password.php
1
<?php
2
3
namespace
Bitrix\Ldap\Internal\Security
;
4
5
use
Bitrix\Main\ArgumentException
;
6
use
Bitrix\Main\Security\Random
;
7
12
final
class
Password
13
{
14
private
int
$length;
15
private
int
$chars;
16
private
string
$value;
17
23
public
function
__construct
(
int
$length = 32,
int
$chars = Random::ALPHABET_ALL)
24
{
25
if
($length <= 0)
26
{
27
throw
new
ArgumentException
(
'Password cannot be empty'
);
28
}
29
30
$this->length = $length;
31
$this->chars = $chars;
32
$this->value = Random::getStringByAlphabet($this->length, $this->chars,
true
);
33
}
34
35
public
function
__toString
()
36
{
37
return
$this->value;
38
}
39
}
Bitrix\Ldap\Internal\Security\Password
Definition
Password.php:13
Bitrix\Ldap\Internal\Security\Password\__toString
__toString()
Definition
Password.php:35
Bitrix\Ldap\Internal\Security\Password\__construct
__construct(int $length=32, int $chars=Random::ALPHABET_ALL)
Definition
Password.php:23
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\Security\Random
Definition
random.php:6
Bitrix\Ldap\Internal\Security
Definition
Encryption.php:3
modules
ldap
lib
Internal
Security
Password.php
Создано системой
1.10.0