Documentation

BcryptHasher extends AbstractHasher
in package

Pop Crypt Bcrypt hasher

Tags
category

Pop

author

Nick Sagona, III dev@noladev.com

copyright

Copyright (c) 2009-2026 NOLA Interactive, LLC.

license

https://www.popphp.org/license New BSD License

version
3.0.0

Table of Contents

Properties

$cost  : int
Cost

Methods

__construct()  : mixed
Constructor
create()  : static
Create hasher object with options
createHash()  : string
Create hashed value
getAlgorithms()  : array<string|int, mixed>
Get available hashing algorithms
getCost()  : int
Get cost
getInfo()  : array<string|int, mixed>
Get info from hashed value
hasCost()  : bool
Has cost
make()  : string
Make hashed value (based on the hasher class)
needsRehash()  : bool
Determine if the hashed value needs to be re-hashed
requiresRehash()  : bool
Determine if the hashed value requires re-hashing (based on the hasher class)
setCost()  : BcryptHasher
Set cost
setOptions()  : static
Set hasher options
verify()  : bool
Verify hash

Properties

Methods

__construct()

Constructor

public __construct([int $cost = 12 ]) : mixed

Instantiate the Bcrypt object

Parameters
$cost : int = 12

create()

Create hasher object with options

public static create([array<string|int, mixed> $options = [] ]) : static
Parameters
$options : array<string|int, mixed> = []
Return values
static

createHash()

Create hashed value

public createHash(string $value, string|int|null $algorithm[, array<string|int, mixed> $options = [] ]) : string
Parameters
$value : string
$algorithm : string|int|null
$options : array<string|int, mixed> = []
Return values
string

getAlgorithms()

Get available hashing algorithms

public getAlgorithms() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCost()

Get cost

public getCost() : int
Return values
int

getInfo()

Get info from hashed value

public getInfo(string $hashedValue) : array<string|int, mixed>
Parameters
$hashedValue : string
Return values
array<string|int, mixed>

hasCost()

Has cost

public hasCost() : bool
Return values
bool

make()

Make hashed value (based on the hasher class)

public make(string $value) : string
Parameters
$value : string
Return values
string

needsRehash()

Determine if the hashed value needs to be re-hashed

public needsRehash(string $hashedValue, string|int|null $algorithm[, array<string|int, mixed> $options = [] ]) : bool
Parameters
$hashedValue : string
$algorithm : string|int|null
$options : array<string|int, mixed> = []
Return values
bool

requiresRehash()

Determine if the hashed value requires re-hashing (based on the hasher class)

public requiresRehash(string $hashedValue) : bool
Parameters
$hashedValue : string
Return values
bool

setOptions()

Set hasher options

public setOptions(array<string|int, mixed> $options) : static
Parameters
$options : array<string|int, mixed>
Return values
static

verify()

Verify hash

public verify(string $value, string $hashedValue) : bool
Parameters
$value : string
$hashedValue : string
Return values
bool

        
On this page

Search results