appwrite/src/Appwrite/Utopia/Response/Model/AlgoScrypt.php

66 lines
1.6 KiB
PHP
Raw Normal View History

2022-06-15 08:11:48 +00:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class AlgoScrypt extends Model
{
public function __construct()
{
$this
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Algo type.',
'default' => 'scrypt',
'example' => 'scrypt',
])
2022-06-16 09:21:35 +00:00
->addRule('costCpu', [
2022-06-15 08:11:48 +00:00
'type' => self::TYPE_INTEGER,
'description' => 'CPU complexity of computed hash.',
'default' => 8,
2022-06-15 08:11:48 +00:00
'example' => 8,
])
2022-06-16 09:21:35 +00:00
->addRule('costMemory', [
2022-06-15 08:11:48 +00:00
'type' => self::TYPE_INTEGER,
'description' => 'Memory complexity of computed hash.',
'default' => 14,
2022-06-15 08:11:48 +00:00
'example' => 14,
])
2022-06-16 09:21:35 +00:00
->addRule('costParallel', [
2022-06-15 08:11:48 +00:00
'type' => self::TYPE_INTEGER,
'description' => 'Parallelization of computed hash.',
'default' => 1,
2022-06-15 08:11:48 +00:00
'example' => 1,
])
->addRule('length', [
'type' => self::TYPE_INTEGER,
'description' => 'Length used to compute hash.',
'default' => 64,
'example' => 64,
2022-06-15 08:11:48 +00:00
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
2022-06-17 09:25:28 +00:00
return 'AlgoScrypt';
2022-06-15 08:11:48 +00:00
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_ALGO_SCRYPT;
}
}