--- title: "bcrypt hash password()" slug: "basic-b-crypt-hash-password" updated: 2026-08-10T08:45:30Z published: 2026-08-10T08:45:30Z canonical: "docs.lobstersoftware.com/basic-b-crypt-hash-password" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # bcrypt hash password() The function generates a bcrypt hash value from password ***a*** and salt value ***b***. ## Parameters | Parameter | Description | | --- | --- | | a | The password for which the hash value is to be generated. | | b | (optional) The salt value. If none is specified, a new one is created internally. To generate the salt value, the function [bcrypt generate salt()](/v1/docs/en/basic-b-crypt-generate-salt) can be used. **NOTE:** If you do not specify a salt value, a new one is generated internally each time. The result is a different hash value each time. | ## Examples | Parameter a | Parameter b | Result | | --- | --- | --- | | mypassword | | $2a$10$oZE/GfU/Qm0LfCuTor81peGE.MSsJZdR7Ni4YZv3VLb3l4h3UeWsa | | mypassword | $2a$10$yzazaE5KTM6o4uK/nt0rce | $2a$10$yzazaE5KTM6o4uK/nt0rceoOOYsliLa7GaOEZqLaRahE.dDpEkci6 |