yiier / yii2-hashids

Hashids for Yii2

Home Page:http://hashids.org/php/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yii2 for hashids

Build Status version Download Issues

Installation

Install this package via Composer:

$ composer require yiier/yii2-hashids

Usage

configurate is as a component

In your main.php or web.php (dependences your yii2 project constructor):

[
	'hahsids' => [
		'class' => 'yiier\hashids\Hashids',
		//'salt' => 'your salt',
		//'minHashLength' => 5,
		//'alphabet' => 'abcdefghigk'
	]
]

Also using this like this:

$hashids = Yii::createObject([
	'class' => 'yiier\hashids\Hashids'
]);

$id = $hashids->encode(1, 2, 3);
$numbers = $hashids->decode($id);
var_dump($id, $numbers);

Test

$ phpunit

Lisence

MIT

About

Hashids for Yii2

http://hashids.org/php/


Languages

Language:PHP 100.0%