\CryptoManana\Core\Traits\MessageDigestionSaltingCapabilitiesTrait

Trait SaltingCapabilitiesTrait - Reusable implementation of `SaltingCapabilitiesInterface`.

Summary

Methods
Properties
Constants
setSalt()
getSalt()
setSaltingMode()
getSaltingMode()
$$salt
$$saltingMode
No constants found
saltAtFront()
saltAtBack()
saltAtSpecial()
addSaltString()
$inFrontCases
$inBackCases
$inSpecialCases
N/A
No private methods found
No private properties found
N/A

Properties

$$salt

$$salt : string

The salt string property storage.

Type

string

$$saltingMode

$$saltingMode : integer

The salting mode property storage.

Type

integer

$inFrontCases

$inFrontCases : array

List of salting modes that add the salt at the front side of the input data.

Type

array — Salting mode codes.

$inBackCases

$inBackCases : array

List of salting modes that add the salt at the back side of the input data.

Type

array — Salting mode codes.

$inSpecialCases

$inSpecialCases : array

List of salting modes that use complex salt and input data manipulation procedures.

Type

array — Salting mode codes.

Methods

setSalt()

setSalt(string  $salt) : $this

Setter for the salt string property.

Parameters

string $salt

The salt string.

Throws

\Exception

Validation errors.

Returns

$this —

The hash algorithm object.

getSalt()

getSalt() : string

Getter for the salt string property.

Returns

string —

The salt string.

setSaltingMode()

setSaltingMode(integer  $saltingMode) : $this

Setter for the salting mode code property.

Parameters

integer $saltingMode

The salting mode code.

Throws

\Exception

Validation errors.

Returns

$this —

The hash algorithm object.

getSaltingMode()

getSaltingMode() : integer

Getter for the salt mode code property.

Returns

integer —

The salt mode code.

saltAtFront()

saltAtFront(string  $data) 

Internal method for grouping salting modes that add to the front of the input data.

Parameters

string $data

The input data for hashing.

saltAtBack()

saltAtBack(string  $data) 

Internal method for grouping salting modes that add to the back of the input data.

Parameters

string $data

The input data for hashing.

saltAtSpecial()

saltAtSpecial(string  $data) 

Internal method for grouping salting modes that use complex manipulations of the salt and input data.

Parameters

string $data

The input data for hashing.

addSaltString()

addSaltString(string  $data) : string

Internal method for adding the salt string to the input data via the chosen salting mode.

Parameters

string $data

The input data for hashing.

Returns

string —

The input data with proper salting.