-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code style
- Loading branch information
Showing
17 changed files
with
139 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Release | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?php | ||
|
||
$header = <<<'EOF' | ||
This file is part of Hyperf. | ||
This file is part of hyperf-ext/hashing. | ||
@link https://www.hyperf.io | ||
@document https://hyperf.wiki | ||
@contact [email protected] | ||
@license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
@link https://github.com/hyperf-ext/hashing | ||
@contact [email protected] | ||
@license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
EOF; | ||
|
||
return PhpCsFixer\Config::create() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of hyperf-ext/hashing. | ||
* | ||
* @link https://github.com/hyperf-ext/hashing | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
*/ | ||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Default Hash Driver | ||
|
@@ -31,7 +36,7 @@ | |
|
||
'bcrypt' => [ | ||
'class' => \HyperfExt\Hashing\Driver\BcryptDriver::class, | ||
'options'=> [ | ||
'options' => [ | ||
'rounds' => env('BCRYPT_ROUNDS', 10), | ||
], | ||
], | ||
|
@@ -49,7 +54,7 @@ | |
|
||
'argon2i' => [ | ||
'class' => \HyperfExt\Hashing\Driver\Argon2IDriver::class, | ||
'options'=> [ | ||
'options' => [ | ||
'memory' => 1024, | ||
'threads' => 2, | ||
'time' => 2, | ||
|
@@ -58,12 +63,11 @@ | |
|
||
'argon2id' => [ | ||
'class' => \HyperfExt\Hashing\Driver\Argon2IdDriver::class, | ||
'options'=> [ | ||
'options' => [ | ||
'memory' => 1024, | ||
'threads' => 2, | ||
'time' => 2, | ||
], | ||
], | ||
], | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,11 @@ | |
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* This file is part of hyperf-ext/hashing. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://doc.hyperf.io | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
* @link https://github.com/hyperf-ext/hashing | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
*/ | ||
namespace HyperfExt\Hashing; | ||
|
||
|
@@ -32,8 +31,8 @@ public function __invoke(): array | |
[ | ||
'id' => 'config', | ||
'description' => 'The config for HyperfExt\\Hashing.', | ||
'source' => __DIR__ . '/../publish/ext-hashing.php', | ||
'destination' => BASE_PATH . '/config/autoload/ext-hashing.php', | ||
'source' => __DIR__ . '/../publish/hashing.php', | ||
'destination' => BASE_PATH . '/config/autoload/hashing.php', | ||
], | ||
], | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of hyperf-ext/hashing. | ||
* | ||
* @link https://github.com/hyperf-ext/hashing | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
*/ | ||
namespace HyperfExt\Hashing\Contract; | ||
|
||
interface DriverInterface | ||
{ | ||
/** | ||
* Get information about the given hashed value. | ||
* | ||
* @param string $hashedValue | ||
* | ||
* @return array | ||
*/ | ||
public function info(string $hashedValue): array; | ||
|
||
/** | ||
* Hash the given value. | ||
* | ||
* @param string $value | ||
* @param array $options | ||
* | ||
* @return string | ||
*/ | ||
public function make(string $value, array $options = []): string; | ||
|
||
/** | ||
* Check the given plain value against a hash. | ||
* | ||
* @param string $value | ||
* @param string $hashedValue | ||
* @param array $options | ||
* | ||
* @return bool | ||
*/ | ||
public function check(string $value, string $hashedValue, array $options = []): bool; | ||
|
||
/** | ||
* Check if the given hash has been hashed using the given options. | ||
* | ||
* @param string $hashedValue | ||
* @param array $options | ||
* | ||
* @return bool | ||
*/ | ||
public function needsRehash(string $hashedValue, array $options = []): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of hyperf-ext/hashing. | ||
* | ||
* @link https://github.com/hyperf-ext/hashing | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
*/ | ||
namespace HyperfExt\Hashing\Contract; | ||
|
||
interface HashInterface extends DriverInterface | ||
{ | ||
/** | ||
* Get a driver instance. | ||
* | ||
* @param string|null $name | ||
* | ||
* @return \HyperfExt\Hashing\Contract\DriverInterface | ||
*/ | ||
public function getDriver(?string $name = null): DriverInterface; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of hyperf-ext/hashing. | ||
* | ||
* @link https://github.com/hyperf-ext/hashing | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf-ext/hashing/blob/master/LICENSE | ||
*/ | ||
namespace HyperfExt\Hashing\Driver; | ||
|
||
abstract class AbstractDriver | ||
{ | ||
/** | ||
* Get information about the given hashed value. | ||
* | ||
* @param string $hashedValue | ||
* | ||
* @return array | ||
*/ | ||
public function info(string $hashedValue): array | ||
{ | ||
|
@@ -20,12 +22,6 @@ public function info(string $hashedValue): array | |
|
||
/** | ||
* Check the given plain value against a hash. | ||
* | ||
* @param string $value | ||
* @param string $hashedValue | ||
* @param array $options | ||
* | ||
* @return bool | ||
*/ | ||
public function check(string $value, string $hashedValue, array $options = []): bool | ||
{ | ||
|
Oops, something went wrong.