wp-kit/hashing
This is a wp-kit component that handles password hashing., (*1)
This component was built to run within an Illuminate\Container\Container
so is perfect for frameworks such as Themosis
, Assely
and wp-kit/theme
., (*2)
wp-kit/hashing
was built to support wp-kit/auth
when authenticating users and comparing the input password against the stored password in WordPress., (*3)
There are many good reasons to use Eloquent
but often password hashing on users can get in the way of using Eloquent
to manage authentication in WordPress, and wp-kit/hashing
aims to solve this problem., (*4)
Installation
If you're using Themosis
, install via Composer
in the root of your Themosis
installation, otherwise install in your Composer
driven theme folder:, (*5)
composer require "wp-kit/hashing"
Setup
Add Service Provider
Just register the service provider in the providers config:, (*6)
//inside theme/resources/config/providers.config.php
return [
//
WPKit\Hashing\HashingServiceProvider::class
];
Add Facade
If you are using Themosis or another Iluminate
driven framework, you may want to add Facades
, simply add them to your aliases:, (*7)
//inside themosis-theme/resource/config/theme.config.php
'aliases' => [
//
'Hasher' => WPKit\Hashing\Facades\Hasher::class
//
]
Usage
If you are using wp-kit/auth
, hashing will work out of the box as illuminate/auth
listens to the hash binding on the container which is register by HashingServiceProvider
. However you can use the Hasher
elsewhere in your application if you wish:, (*8)
use WPKit\Hashing\Facades\Hasher;
$hashed = Hasher::make('some_password');
$validated = Hasher::check('some_password', $hashed);
Get Involved
To learn more about how to use wp-kit
check out the docs:, (*9)
View the Docs, (*10)
Any help is appreciated. The project is open-source and we encourage you to participate. You can contribute to the project in multiple ways by:, (*11)
- Reporting a bug issue
- Suggesting features
- Sending a pull request with code fix or feature
- Following the project on GitHub
- Sharing the project around your community
For details about contributing to the framework, please check the contribution guide., (*12)
Requirements
Wordpress 4+, (*13)
PHP 5.6+, (*14)
License
wp-kit/hashing is open-sourced software licensed under the MIT License., (*15)