adonis5-pbkdf2
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

adonis5-pbkdf2

npm-image license-image typescript-image

A package that adds PBKDF2 to the hashers of Adonisjs v5.

Installation

Install adonis5-pbkdf2 via npm or yarn:

npm install adonis5-pbkdf2
//Or, with yarn: yarn add adonis5-pbkdf2

Configure

After the package has been installed, you have to configure it by running a command:

node ace configure adonis5-pbkdf2

Then, you need to edit your .env file to add or edit the HASH_DRIVER key:

HASH_DRIVER=pbkdf2

If you want to also allow typescript to typecheck the .env file, edit the env.ts file and add the following line:

export default Env.rules({
	//....
    HASH_DRIVER: Env.schema.enum(['bcrypt','argon','pbkdf2'] as const), //<---- add this line
})

Usage

You can use pbfdf2 through the Hash class, like any other hasher:

import Hash from '@ioc:Adonis/Core/Hash'
const hashedPassword = await Hash.make("hello world")

Readme

Keywords

Package Sidebar

Install

npm i adonis5-pbkdf2

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

13.8 kB

Total Files

10

Last publish

Collaborators

  • maxgalbu