PHP 클래스 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.
상속: extends AbstractSimpleOperator
파일 보기 프로젝트 열기: vimeo/ablincoln

공개 메소드들

메소드 설명
__construct ( array $options, mixed $inputs ) Constructor: store given parameters and establish scale for hashing

보호된 메소드들

메소드 설명
_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

비공개 메소드들

메소드 설명
_getUnit ( mixed $appended_unit = null ) : array Format all units into an array before hashing

메소드 상세

__construct() 공개 메소드

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() 보호된 메소드

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
리턴 integer decimal representation of computed SHA1 hash

_getUniform() 보호된 메소드

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