bcryptHash
bcryptHash
bcryptHash
I encode passwords using a popular secure password hashing algorithm called bcrypt. I am very slow, but that makes me very secure!
Metadata
| Instantiating |
encode()
Convert a clear password to its encoded value
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| password | string | Yes | Input password |
getHashWorkFactor()
Retrieve the work factor from a hashed string
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| hashedPassword | string | Yes | Previously encoded password string |
init()
constructor
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| None | |||||
isAvailable()
Is the hashing agorithm available in this environment?
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| None | |||||
matchesHashFormat()
Does the string match the format for this hash?
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| input | string | Yes | String that may be a password hash |
passwordMatch()
Compare a plain password against an encoded string
Arguments
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| password | string | Yes | Input password | ||
| hashedPassword | string | Yes | Previously encoded password string | ||
| bCheckHashStrength | boolean | No | false | If true, the hash strength of the hashed password must also match those generated by encode() |