Hash configuration

This commit is contained in:
Marcin Łojewski
2018-07-10 22:19:50 +02:00
parent 50da49c820
commit 924886dd9a
9 changed files with 105 additions and 2 deletions

View File

@@ -48,6 +48,19 @@ class CryptExtendedDES extends AbstractCrypt
$this->iterationCount = $iterationCount;
}
/**
* @inheritdoc
*/
public function configuration()
{
return [
[
"name" => "iterations", "visible_name" => "Iterations", "default" => 1000,
"min" => 0, "max" => 16777215
]
];
}
/**
* @inheritdoc
*/
@@ -76,7 +89,7 @@ class CryptExtendedDES extends AbstractCrypt
while ($number) {
$rem = $number % $base;
$number = (int)($number / $base);
$arr[] = $alphabet[$rem];
$chars[] = $alphabet[$rem];
}
return str_pad(implode($chars), 4, ".", STR_PAD_RIGHT);