public function getValueHash($value, $algorithm = null)
    {
        $salt = $this->offsetExists('salt') ? $this->offsetGet('salt') : '';

        if (false === strpos($salt, '%s')) {
            $salted = $salt . $value;
        } else {
            $salted = sprintf($salt, $value);
        }

        // \MUtil_Echo::track($value, md5($salted));
        if (null == $algorithm) {
            return md5($salted, false);
        }

        return hash($algorithm, $value, false);
    }
public function getValueHash($value, $algorithm = null)
    {
        $salt = $this->offsetExists('salt') ? $this->offsetGet('salt') : '';

        if (false === strpos($salt, '%s')) {
            $salted = $salt . $value;
        } else {
            $salted = sprintf($salt, $value);
        }

        // \MUtil_Echo::track($value, md5($salted));
        if (null == $algorithm) {
            return md5($salted, false);
        }

        return hash($algorithm, $value, false);
    }
public function getValueHash ( $ value , $ algorithm = null ) { $ salt = $ this -> offsetExists ( 'salt' ) ? $ this -> offsetGet ( 'salt' ) : '' ; if ( false === strpos ( $ salt , '%s' ) ) { $ salted = $ salt . $ value ; } else { $ salted = sprintf ( $ salt , $ value ) ; } // \MUtil_Echo::track($value, md5($salted));
 if ( null == $ algorithm ) { return md5 ( $ salted , false ) ; } return hash ( $ algorithm , $ value , false ) ; }
Returns a salted hash optionally using the specified hash algorithm

@param string $value The value to hash
@param string $algoritm Optional, hash() algorithm; uses md5() otherwise
@return string The salted hexadecimal hash, length depending on the algorithm (32 for md5, 128 for sha512.
Returns a salted hash optionally using the specified hash algorithm