@types/bcrypt-nodejs

  • Version 0.0.31
  • Published
  • 5.39 kB
  • No dependencies
  • MIT license

Install

npm i @types/bcrypt-nodejs
yarn add @types/bcrypt-nodejs
pnpm add @types/bcrypt-nodejs

Overview

TypeScript definitions for bcrypt-nodejs

Index

Functions

function compare

compare: (
data: string,
hash: string,
callback: (error: Error, result: boolean) => void
) => void;
  • Compares data with a hash asynchronously

    Parameter data

    Data to be compared

    Parameter hash

    Hash to be compared to

    Parameter callback

    Callback with error and match result, to be fired once the data has been compared

function compareSync

compareSync: (data: string, hash: string) => boolean;
  • Compares data with a hash synchronously

    Parameter data

    Data to be compared

    Parameter hash

    Hash to be compared to true if matching, false otherwise

function genSalt

genSalt: (
rounds: number,
callback: (error: Error, result: string) => void
) => void;
  • Generate a salt asynchronously

    Parameter rounds

    Number of rounds to process the data for (default - 10)

    Parameter callback

    Callback with error and resulting salt, to be fired once the salt has been generated

function genSaltSync

genSaltSync: (rounds?: number) => string;
  • Generate a salt synchronously

    Parameter rounds

    Number of rounds to process the data for (default - 10) Generated salt

function getRounds

getRounds: (hash: string) => number;
  • Get number of rounds used for hash

    Parameter hash

    Hash from which the number of rounds used should be extracted number of rounds used to encrypt a given hash

function hash

hash: {
(
data: string,
salt: string,
callback: (error: Error, result: string) => void
): void;
(
data: string,
salt: string,
progressCallback: () => void,
callback: (error: Error, result: string) => void
): void;
};
  • Generate a hash asynchronously

    Parameter data

    Data to be encrypted

    Parameter salt

    Salt to be used in encryption

    Parameter callback

    Callback with error and hashed result, to be fired once the data has been encrypted

  • Generate a hash asynchronously

    Parameter data

    Data to be encrypted

    Parameter salt

    Salt to be used in encryption

    Parameter progressCallback

    Callback to be fired multiple times during the hash calculation to signify progress

    Parameter callback

    Callback with error and hashed result, to be fired once the data has been encrypted

function hashSync

hashSync: (data: string, salt?: string) => string;
  • Generate a hash synchronously

    Parameter data

    Data to be encrypted

    Parameter salt

    Salt to be used in encryption (default - new salt generated with 10 rounds) Generated hash

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/bcrypt-nodejs.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/bcrypt-nodejs)
  • HTML
    <a href="https://www.jsdocs.io/package/@types/bcrypt-nodejs"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>