PHP Class Vimeo\ABLincoln\Operators\RandomOperator

Required Inputs: None Optional Inputs: - 'salt': salt for hash (should generally be unique for each random variable). If 'salt' input not specified, parameter name is used as random variable salt.
Inheritance: extends AbstractSimpleOperator
Afficher le fichier Open project: vimeo/ablincoln

Méthodes publiques

Méthode Description
__construct ( array $options, mixed $inputs ) Constructor: store given parameters and establish scale for hashing

Méthodes protégées

Méthode Description
_getHash ( mixed $appended_unit = null ) : integer Form a complete salt string and hash it to a number
_getUniform ( $min_val, $max_val = 1, $appended_unit = null ) : float Get a random decimal between two provided values

Private Methods

Méthode Description
_getUnit ( mixed $appended_unit = null ) : array Format all units into an array before hashing

Method Details

__construct() public méthode

Constructor: store given parameters and establish scale for hashing
public __construct ( array $options, mixed $inputs )
$options array array mapping operator options to values
$inputs mixed input value/array used for hashing

_getHash() protected méthode

Form a complete salt string and hash it to a number
protected _getHash ( mixed $appended_unit = null ) : integer
$appended_unit mixed optional extra unit used for hashing
Résultat integer decimal representation of computed SHA1 hash

_getUniform() protected méthode

Get a random decimal between two provided values
protected _getUniform ( $min_val, $max_val = 1, $appended_unit = null ) : float
Résultat float random number between the two provided values