Fat-Free Framework  3.3.0  Overview Class List Hierarchy
Public Member Functions | Public Attributes | List of all members
Bcrypt Class Reference

Lightweight password hashing library. More...

+ Inheritance diagram for Bcrypt:

Public Member Functions

 hash ($pw, $salt=NULL, $cost=self::COST)
 
 needs_rehash ($hash, $cost=self::COST)
 
 verify ($pw, $hash)
 

Public Attributes

const COST =10
 Default cost.
 
const E_CostArg ='Invalid cost parameter'
 
const E_SaltArg ='Salt must be at least 22 alphanumeric characters'
 

Additional Inherited Members

- Static Public Member Functions inherited from Prefab
static instance ()
 

Detailed Description

Lightweight password hashing library.

Member Function Documentation

Bcrypt::hash (   $pw,
  $salt = NULL,
  $cost = self::COST 
)

Generate bcrypt hash of string

Returns
string|FALSE
Parameters
$pwstring
$saltstring
$costint
Bcrypt::needs_rehash (   $hash,
  $cost = self::COST 
)

Check if password is still strong enough

Returns
bool
Parameters
$hashstring
$costint
Bcrypt::verify (   $pw,
  $hash 
)

Verify password against hash using timing attack resistant approach

Returns
bool
Parameters
$pwstring
$hashstring

The documentation for this class was generated from the following file: