terabytesoftw / helper-password
Template giyhub yii2
Installs: 105
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.2.0
- oomphinc/composer-installers-extender: ^1.1
- yiisoft/yii2: ^2.0.20
Requires (Dev)
- codeception/c3: 2.*
- codeception/codeception: ^3.0
- codeception/specify: *
- codeception/verify: *
- dms/phpunit-arraysubset-asserts: ^0.1.0
- hiqdev/composer-config-plugin: ^1.0@dev
- monolog/monolog: *
- yiisoft/yii2-debug: ~2.1.0
- yiisoft/yii2-faker: ~2.0.0
- yiisoft/yii2-gii: ~2.1.0
This package is auto-updated.
Last update: 2024-10-13 04:52:16 UTC
README
Helper Password
DIRECTORY STRUCTURE:
config/ contains application configurations
src/ contains source files
tests/ contains tests codeception for the web application
vendor/ contains dependent 3rd-party packages
REQUIREMENTS:
- The minimum requirement by this project template that your Web server supports:
- PHP 7.2 or higher.
INSTALLATION:
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this extension using the following command composer:
composer require terabytesoftw/helper-password '^1.0@dev'
or add composer.json:
"terabytesoftw/helper-password":"^1.0@dev"
USAGE:
<?php
use terabytesoft\helpers\Password;
// config params defaults config/helperpassword.php
// config default 3 - ARGON2DI - PHP >= 7.3
'helper.password.algo' => 3, // 1 BCRYPT, 2 ARGON2I, 3 ARGON2DI
'helper.password.options' => [
'memory_cost' => 1<<17,
'time_cost' => 3,
'threads' => 4,
]
/**
* config 2 - ARGON2I - PHP >= 7.2
* 'helper.password.algo' => 2, // 1 BCRYPT, 2 ARGON2I, 3 ARGON2DI
* 'helper.password.options' => [
* 'memory_cost' => 1<<17,
* 'time_cost' => 3,
* 'threads' => 4,
* ]
**/
/**
* config 1 - BCRYPT
* 'helper.password.algo' => 1, // 1 BCRYPT, 2 ARGON2I, 3 ARGON2DI
* 'helper.password.options' => [
* 'cost' => 8,
* ]
**/
// generate password ramdom
$passwordrandom = $this->password->generate(8);
// generate hash:
$hash = $this->password->hash(
$passwordrandom,
\Yii::$app->params['helper.password.algo'],
\Yii::$app->params['helper.password.options']
);
// validate password
$this->password->validate($passwordrandom, $hash);
RUN TESTS CODECEPTION:
// download all composer dependencies root project
$ composer update --prefer-dist -vvv
// run all tests with code coverage
$ vendor/bin/codecept run unit --coverage-xml
WEB SERVER SUPPORT:
- Apache.
- Nginx.
- OpenLiteSpeed.