# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ondiagram.com/nodes/bcrypt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
