Initial commit

This commit is contained in:
2023-12-26 20:24:42 +01:00
commit 66d0377a00
657 changed files with 21841 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
## 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
}
```