generated from cms/tibi-docs
backend & types
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
## bcrypt
|
||||
|
||||
Das BcryptPackage-Interface bietet Funktionen zur Passworthashing und -überprüfung mit dem bcrypt-Algorithmus. Es beinhaltet folgende Methoden:
|
||||
|
||||
- `hash(password: string, options?: {}: string`:
|
||||
Diese Methode nimmt ein Klartextpasswort und optionale Hashing-Optionen entgegen und gibt das gehashte Passwort zurück. Die Optionen können den "cost"-Parameter steuern, der die Komplexität des Hashings bestimmt.
|
||||
|
||||
- `check(password: string, hash: string): boolean`:
|
||||
Diese Methode nimmt ein Klartextpasswort und ein gehashtes Passwort entgegen und gibt zurück, ob das Klartextpasswort nach dem Hashing mit dem gehashten Passwort übereinstimmt.
|
||||
|
||||
```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
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user