core/model/modx/hashing/modpbkdf2.class.php

Show: inherited
Table of Contents

This file contains a modHash implementation of RSA PDKDF2.

Package
modx  
Subpackage
hashing  

\modPBKDF2

Package: modx\hashing

A PBKDF2 implementation of modHash.

Parent(s)
\modHash

Properties

Propertypublic\modHashing  $host= 'null'
inherited

A reference to the modHashing service hosting this modHash instance.

Inherited from: \modHash::$$host
Default valuenullDetails
Type
\modHashing
Inherited_from
\modHash::$$host  
Propertypublicarray  $options= 'array()'
inherited

An array of options for the modHash implementation.

Inherited from: \modHash::$$options
Default valuearray()Details
Type
array
Inherited_from
\modHash::$$options  

Methods

methodpublic__construct( \modHashing $host, array | null $options = array() ) : \modHash
inherited

Constructs a new instance of the modHash class.

Inherited from: \modHash::__construct()
Parameters
Name Type Description
$host \modHashing

A reference to the modHashing instance

$options array | null

An optional array of configuration options

Returns
Type Description
\modHash A new derivative instance of the modHash class
methodpublicgetOption( string $key, array | null $options = null, mixed $default = null ) : mixed
inherited

Get an option for this modHash implementation

Inherited from: \modHash::getOption()

Searches for local options and then prefixes keys with hashing_ to look for MODX System Settings.

Parameters
Name Type Description
$key string

The option key to get a value for.

$options array | null

An optional array of options to look in first.

$default mixed

An optional default value to return if no value is set.

Returns
Type Description
mixed The option value or the specified default if not found.
methodpublichash( string $string, array $options = array() ) : mixed

Generate a hash of a string using the RSA PBKDFA2 specification.

The following options are available: - salt (required): a valid, non-empty string to salt the hashes - iterations: the number of iterations per block, default is 1000 (< 1000 not recommended) - derived_key_length: the size of the derived key to generate, default is 32 - algorithm: the hash algorithm to use, default is sha256 - raw_output: if true, returns binary output, otherwise derived key is base64_encode()'d; default is false

Parameters
Name Type Description
$string string

A string to generate a secure hash from.

$options array

An array of options to be passed to the hash implementation.

Returns
Type Description
mixed The hash result or false on failure.
Documentation was generated by DocBlox 0.18.1.