1.0.2 • Published 6 months ago

@types/phc__bcrypt v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for @phc/bcrypt 1.0
// Project: https://github.com/simonepri/phc-bcrypt
// Definitions by: Toan Nguyen <https://github.com/vespaiach>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Wed, 28 Jul 2021 00:01:22 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Toan Nguyen.

1.0.2

6 months ago

1.0.1

7 months ago

1.0.0

3 years ago