27 lines
511 B
Markdown
27 lines
511 B
Markdown
## bcrypt
|
|
|
|
```ts
|
|
interface BcryptPackage {
|
|
/**
|
|
* hash password via bcrypt algo
|
|
*
|
|
* @param password clear text password
|
|
* @param options hashing options
|
|
*/
|
|
hash(
|
|
password: string,
|
|
options?: {
|
|
cost?: number
|
|
}
|
|
): string
|
|
|
|
/**
|
|
* check password against hashed password via bcrypt algo
|
|
*
|
|
* @param password clear text password
|
|
* @param hash hashed password
|
|
*/
|
|
check(password: string, hash: string): boolean
|
|
}
|
|
```
|