# Bcrypt Hash String

> Apply a one-way hash to a string using bcrypt.

- ID: `bcrypt_hash`
- Type: Block
- Category: [Strings](https://inventor.bot/docs/reference/blocks/strings.md)

- Value block: it can be used directly inside expressions, e.g. `"Result: " + bcrypt_hash(Args{...})`.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `text` | yes | String to hash. | e.g. `"password"` |
| `cost` |  | Advanced option. Defaults to 10. Must be between 4 and 20 (inclusive). | e.g. `"10"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `hashed_string` | Resulting bcrypt hash. | e.g. `"$2a$10$..."` |

**Example**

```go
bcryptHash := bcrypt_hash(Args{text: "password"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Hashed String: " + bcryptHash,
})
```