limingxinleo/i-encryption

Illuminate Encryption for Hyperf
592 6
Install
composer require limingxinleo/i-encryption
Latest Version:v1.1.0
PHP:>=7.2
License:MIT
Last Updated:Apr 1, 2022
Links: GitHub  ·  Packagist
Maintainer: limingxinleo

Laravel 加密解密

illuminate/encryption

安装

composer require limingxinleo/i-encryption

配置

<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
return [
    'default' => [
        'key' => '',
        'cipher' => '',
    ],
];

使用

use Hyperf\Utils\ApplicationContext;
use Illuminate\Encryption\Contracts\Encrypter;

$encrypter = ApplicationContext::getContainer()->get(Encrypter::class);

$encrypted = $encrypter->encrypt('foo');
$decrypted = $encrypter->decrypt($encrypted);

Related Packages

cooper/hyperf-pest

Pest Testing for hyperf

29 2
hyperf/scout

Hyperf Scout provides a driver based solution to searching your Eloquent models....

178,011 6
hyperf/tappable

Hyperf Macroable package which come from illuminate/tappable

1,429,135 1
hyperf/conditionable

Hyperf Macroable package which come from illuminate/conditionable

1,419,839 0
hyperf/stringable

Hyperf Stringable package which come from illuminate/support

1,435,403 0