@types/phc__bcrypt
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Installation

npm install --save @types/phc__bcrypt

Summary

This package contains type definitions for @phc/bcrypt (https://github.com/simonepri/phc-bcrypt).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/phc__bcrypt.

index.d.ts

export interface Options {
    rounds?: number;
    saltSize?: number;
}

/**
 * Computes the hash string of the given password in the PHC format using bcrypt
 * package.
 * @param password The password to hash.
 * @param [options] Optional configurations related to the hashing
 * function.
 * @param [options.rounds=10] Optional
 * Must be an integer within the range (`4` <= `rounds` <= `31`).
 * @return The generated secure hash string in the PHC
 * format.
 */
export function hash(password: string, options?: Options): Promise<string>;

/**
 * Determines whether or not the hash stored inside the PHC formatted string
 * matches the hash generated for the password provided.
 * @param phcstr Secure hash string generated from this package.
 * @param password User's password input.
 * @returns A boolean that is true if the hash computed
 * for the password matches.
 */
export function verify(hash: string, plainPassword: string): Promise<boolean>;

/**
 * Gets the list of all identifiers supported by this hashing function.
 * @returns A list of identifiers supported by this hashing function.
 */
export function identifiers(): string[];

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Toan Nguyen.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/phc__bcrypt

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

4.85 kB

Total Files

5

Last publish

Collaborators

  • types