sukohi/mtriv
Mtriv
A PHP package mainly developed for Laravel to verify simply.
(This is for Laravel 5+. For Laravel 4.2)
Installation
Add this package name in composer.json
"require": {
"sukohi/mtriv": "2.*"
}
Execute composer command.
composer update
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\Mtriv\MtrivServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'Mtriv' => Sukohi\Mtriv\Facades\Mtriv::class
]
Usage
At first generate public key using secret key, string and expiration(skippable) like the following.
$str = 'STRING, ID and so on...';
$expiration = time(); // Skippable
$public_key = \Mtriv::secretKey('SECRET_KEY')->publicKey($str, $expiration);
and then you can verify.
if(\Mtriv::secretKey('SECRET_KEY')->check($str, $public_key, $expiration)) {
echo 'success!';
}
License
This package is licensed under the MIT License.
Copyright 2014 Sukohi Kuhoh
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
644,549,754
9,698
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
423,477,751
607
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
399,241,428
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.0.1 | ~5.0 | MIT | ||
| 2.0.0 | ~5.0 | MIT | ||
| 1.0.1 | >=5.4.0 | 4.2.* | ||
| 1.0.0 | >=5.4.0 | 4.2.* |