encrypter-util
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Encrypter

To use this library you needs to run something like this:

import { Encrypter } from 'encrypter-util';

const encrypter = new Encrypter();
const user = {
  password: '1234'
}; // Your User Entity

const yourPassword = '1234';

user.password = encrypter.hashPassword(yourPassword); // Your user Password is now hashed
const compareBuffers = encrypter.comparePassword(user.password, yourPassword); // Compare user password to password given with user. Compares the underlying bytes that represent the givenArrayBuffer, TypedArray, or DataView instances using a constant-time algorithm.

console.log(
  user.password, //password hashed
  compareBuffers // true or false | compares the underlying bytes that represent the givenArrayBuffer, TypedArray, or DataView instances using a constant-time algorithm
);

Package Sidebar

Install

npm i encrypter-util

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

20.1 kB

Total Files

15

Last publish

Collaborators

  • douglasfdev