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