Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/normalhuman01/helper-password

Helper Password
https://github.com/normalhuman01/helper-password

Last synced: about 1 month ago
JSON representation

Helper Password

Awesome Lists containing this project

README

        





Helper Password



Unstable Version


Build Status


Build Status


Build Status


Code Quality


Code Intelligence Status


Maintainability

### **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:**

~~~
= 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.

### **DOCUMENTATION STYLE GUIDE:**

[Style CI Documentation PSR2.](https://docs.styleci.io/presets#psr2)

### **LICENCE:**

[![License](https://poser.pugx.org/terabytesoftw/helper-password/license.svg)](LICENSE.md)
[![YiiFramework](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
[![Total Downloads](https://poser.pugx.org/terabytesoftw/helper-password/downloads.svg)](https://packagist.org/packages/terabytesoftw/helper-password)
[![StyleCI](https://github.styleci.io/repos/195531459/shield?branch=master)](https://github.styleci.io/repos/195531459)