# Bcrypt

## General

The `Bcrypt` node is hash plaintext and to compare plaintext with saved hashes.

## Input

CASE: hash

* **Source:** Receives a `String` with the plain text password to hash. Learn more on [bcrypt.compare](https://www.npmjs.com/package/bcrypt#to-check-a-password).

The salt rounds is set to 11.

CASE: compare

* **Source:** Receives two values, a `String` with the plaintext password and another \`String\` with the hash to compare to. Learn more on [bcrypt.compare](https://www.npmjs.com/package/bcrypt#to-check-a-password).

## Output

* **Out:** Returns an `Object` with the specified HTTP request header fields (case-insensitive match). Learn more on [bcrypt.hash](https://www.npmjs.com/package/bcrypt#to-hash-a-password).

## Use Cases

Register a user with a password.

* Request (Post) ➡ Bcrypt (Hash) ➡ Database (Add) ➡ Response (200)

Login a user with a password.

* Request (Post) ➡ Database (Get) ➡ Bcrypt (Compare) ➡ Jwt (Sign) ➡ Response (200)
