NestJS Hasher, is a module that combines several hash libraries into one such as bcrypt and argon. You can use them separately, without affecting anything. This library works only with the NestJS framework.
To use the library you must execute the command below in your project.
$ npm install @sinuos/nestjs-hasher
To use this library, you must declare the module in AppModule
This integration works with this package Bcrypt
import { Module } from '@nestjs/common';
import { NestjsHasherModule } from 'nestjs-hasher';
@Module({
imports: [
NestjsHasherModule.register({
provider: 'bcrypt',
round: 10,
}),
],
})
export class AppModule {}
This integration works with this package Argon
import { Module } from '@nestjs/common';
import { NestjsHasherModule } from 'nestjs-hasher';
@Module({
imports: [
NestjsHasherModule.register({
provider: 'argon',
}),
],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { NestjsHasherService } from '@sinuos/nestjs-haasher';
@Injectable()
export class AppService {
constructor(private readonly service: NestjsHasherService) { }
}
hash(plainText)
to hash a string
check(plainText, hashedValue)
to check if hashed value matched with your string
Please see CHANGELOG for more information what has changed recently.
$ npm run test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.