Método que entrega la firma del SII sobre el nodo DA
@return string Firma en base64
@author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@version 2015-10-30
4285
private function getFirma()
    {
        if (!$this->xml) {
            return false;
        }
        $FRMA = $this->xml->getElementsByTagName('FRMA')->item(0);
        return $FRMA ? $FRMA->nodeValue : false;
    }
296842
public function hashCode()
    {
        $validPk = null !== $this->getUserId() &&
            null !== $this->getRoleId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation user_role_fk_29554a to table user
        if ($this->aUser && $hash = spl_object_hash($this->aUser)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation user_role_fk_1ff99e to table role
        if ($this->aRole && $hash = spl_object_hash($this->aRole)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
581720
public function getCertificacion()
    {
        $datos = $this->getDatos();
        $idk = !empty($datos['TED']['DD']['CAF']['DA']['IDK']) ? (int)$datos['TED']['DD']['CAF']['DA']['IDK'] : null;
        return $idk ? $idk === 100 : null;
    }
1287114
public function returnFullData() {

        $aReturn = Array();

        $aInterface = $this->getSNMP()->realWalk1d(self::OID_IF_Entry);
        $aXInterface = $this->getSNMP()->realWalk1d(self::OID_IF_XEntry);

        $aInterfaceIp = $this->getSNMP()->realWalk1d(self::OID_IF_IP_ADDRESS);
        $aInterfaceIpMask = $this->getSNMP()->realWalk1d(self::OID_IF_IP_ADDRESS_MASK);
        $aInterfaceIpIndex = $this->getSNMP()->realWalk1d(self::OID_IF_IP_ADDRESS_INDEX);
 
        $aInterfaceIpAddress = $aInterfaceMaskAddress = Array();
        foreach ($aInterfaceIp as $keyInterfaceIp => $valueInterfaceIp) {
            $keyIndex = str_replace('.1.3.6.1.2.1.4.20.1.1', '.1.3.6.1.2.1.4.20.1.2', $keyInterfaceIp);
            $keyMask = str_replace('.1.3.6.1.2.1.4.20.1.1', '.1.3.6.1.2.1.4.20.1.3', $keyInterfaceIp);
            $aKeyIndexReseted = array_values($aInterfaceIpIndex[$keyIndex]);
            $aKeyMaskReseted = array_values($aInterfaceIpMask[$keyMask]);
            $aKeyReseted = array_values($valueInterfaceIp);
            $aInterfaceIpAddress[$aKeyIndexReseted[0]][] = $aKeyReseted[0];
            $aInterfaceMaskAddress[$aKeyIndexReseted[0]][] = $aKeyMaskReseted[0];
        }

        $aReturn['index'] = $aInterface[self::OID_IF_INDEX];
        $aReturn['description'] = $aInterface[self::OID_IF_DESCRIPTION];
        $aReturn['type'] = $aInterface[self::OID_IF_TYPE];
        $aReturn['type_desc'] = $this->getSNMP()->translate($aInterface[self::OID_IF_TYPE], self::$IF_TYPES);
        $aReturn['mtu'] = $aInterface[self::OID_IF_MTU];
        $aReturn['speed'] = $aInterface[self::OID_IF_SPEED];
        $aReturn['phys_address'] = $aInterface[self::OID_IF_PHYS_ADDRESS];
        $aReturn['ip_address'] = $aInterfaceIpAddress;
        $aReturn['mask_address'] = $aInterfaceMaskAddress;
        $aReturn['admin_status'] = $aInterface[self::OID_IF_ADMIN_STATUS];
        $aReturn['admin_status_desc'] = $this->getSNMP()->translate($aInterface[self::OID_IF_ADMIN_STATUS], self::$IF_ADMIN_STATES);
        $aReturn['oper_status'] = $aInterface[self::OID_IF_OPER_STATUS];
        $aReturn['oper_status_desc'] = $this->getSNMP()->translate($aInterface[self::OID_IF_OPER_STATUS], self::$IF_ADMIN_STATES);
        $aReturn['last_change'] = $aInterface[self::OID_IF_LAST_CHANGE];
        $aReturn['in_octets'] = $aInterface[self::OID_IF_IN_OCTETS];
        $aReturn['in_unicast_packets'] = $aInterface[self::OID_IF_IN_UNICAST_PACKETS];
        $aReturn['in_non_unicast_packets'] = $aInterface[self::OID_IF_IN_NON_UNICAST_PACKETS];
        $aReturn['in_discards'] = $aInterface[self::OID_IF_IN_DISCARDS];
        $aReturn['in_errors'] = $aInterface[self::OID_IF_IN_ERRORS];
        $aReturn['in_unknown_protocols'] = $aInterface[self::OID_IF_IN_UNKNOWN_PROTOCOLS];
        $aReturn['out_octets'] = $aInterface[self::OID_IF_OUT_OCTETS];
        $aReturn['out_unicast_packets'] = $aInterface[self::OID_IF_OUT_UNICAST_PACKETS];
        $aReturn['out_non_unicast_packets'] = $aInterface[self::OID_IF_OUT_NON_UNICAST_PACKETS];
        $aReturn['out_discards'] = $aInterface[self::OID_IF_OUT_DISCARDS];
        $aReturn['out_errors'] = $aInterface[self::OID_IF_OUT_ERRORS];
        $aReturn['out_queue_length'] = $aInterface[self::OID_IF_OUT_QUEUE_LENGTH];

        $aReturn['name'] = $aXInterface[self::OID_IF_NAME];
        $aReturn['high_speed'] = $aXInterface[self::OID_IF_HIGH_SPEED];
        $aReturn['alias'] = $aXInterface[self::OID_IF_ALIAS];

        return $aReturn;
    }
583241
public function getKey()
    {
        if (Str::startsWith($this->key, 'base64:')) {
            return base64_decode(substr($this->key, 7));
        }

        return $this->key;
    }
410719
public function getBinary()
    {
        $result  = $this->getIdentifier();
        $result .= $this->createLengthPart();
        $result .= $this->getEncodedValue();

        return $result;
    }
757796
public function getSteamID64() {
		if (PHP_INT_SIZE == 4) {
			$ret = new Math_BigInteger();
			$ret = $ret->add((new Math_BigInteger($this->universe))->bitwise_leftShift(56));
			$ret = $ret->add((new Math_BigInteger($this->type))->bitwise_leftShift(52));
			$ret = $ret->add((new Math_BigInteger($this->instance))->bitwise_leftShift(32));
			$ret = $ret->add(new Math_BigInteger($this->accountid));
			return $ret->toString();
		}
		return (string) (($this->universe << 56) | ($this->type << 52) | ($this->instance << 32) | ($this->accountid));
	}
339977
public function getCodigoCliente()
    {
        if (empty($this->codigoCliente)) {
            $this->codigoCliente = Util::formatCnab('9', $this->getCarteiraNumero(), 4) .
                Util::formatCnab('9', $this->getAgencia(), 5) .
                Util::formatCnab('9', $this->getConta(), 7) .
                Util::formatCnab('9', $this->getContaDv() ?: CalculoDV::bradescoContaCorrente($this->getConta()), 1);
        }

        return $this->codigoCliente;
    }
1315950
public function createUrl() {
    $string_data = $this->dataToString();
    $data_to_send = array(
      'hash' => $this->doHash($string_data),
    );
    // Adicionalmente adjuntamos el resto de los valores iniciados en $data
    foreach ($this->data as $name => $value) {
      $data_to_send[$name] = $value;
    }
    $data_to_send['agent'] = $this->agent;

    // Iniciamos CURL
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $this->apiUrl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_to_send);

    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    if ($info['http_code'] == 200) {
      return $output;
    }
    else {
      return FALSE;
    }
  }
635585
public function getSignatureBaseString() {
		$parts = [
			$this->getNormalizedMethod(),
			$this->getNormalizedUrl(),
			$this->getSignableParameters()
		];

		$parts = Util::urlencode( $parts );

		return implode( '&', $parts );
	}
58467
public function getLinhaDigitavel()
    {
        if (!empty($this->campoLinhaDigitavel)) {
            return $this->campoLinhaDigitavel;
        }

        $codigo = $this->getCodigoBarras();

        $s1 = substr($codigo, 0, 4) . substr($codigo, 19, 5);
        $s1 = $s1 . Util::modulo10($s1);
        $s1 = substr_replace($s1, '.', 5, 0);

        $s2 = substr($codigo, 24, 10);
        $s2 = $s2 . Util::modulo10($s2);
        $s2 = substr_replace($s2, '.', 5, 0);

        $s3 = substr($codigo, 34, 10);
        $s3 = $s3 . Util::modulo10($s3);
        $s3 = substr_replace($s3, '.', 5, 0);

        $s4 = substr($codigo, 4, 1);

        $s5 = substr($codigo, 5, 14);

        return $this->campoLinhaDigitavel = sprintf('%s %s %s %s %s', $s1, $s2, $s3, $s4, $s5);
    }
1231215
public function getKey(): string
    {
        if (starts_with($this->key, 'base64:')) {
            return base64_decode(mb_substr($this->key, 7));
        }

        return $this->key;
    }
802193
public function getSignatureBase() {
		$fields = array();

		if ($this->eetStatus !== null) {
			$fields[] = $this->eetStatus;
		}
		if ($this->data) {
			$fields[] = $this->data->getSignatureBase();
		}
		if ($this->verificationMode !== null) {
			$fields[] = $this->verificationMode ? 'true' : 'false';
		}
		if ($this->vatId) {
			$fields[] = $this->vatId;
		}
		if ($this->receiptNumber) {
			$fields[] = $this->receiptNumber;
		}
		if ($this->receiptTime) {
			if (isset($this->rawData['receiptTime']) and $this->rawData['receiptTime']) {
				$fields[] = $this->rawData['receiptTime'];
			} else {
				$fields[] = self::formatTime($this->receiptTime);
			}
		}
		if ($this->evidenceMode !== null) {
			$fields[] = $this->evidenceMode;
		}
		if ($this->uuid !== null) {
			$fields[] = $this->uuid;
		}
		if ($this->sendTime) {
			if (isset($this->rawData['sendTime']) and $this->rawData['sendTime']) {
				$fields[] = $this->rawData['sendTime'];
			} else {
				$fields[] = self::formatTime($this->sendTime);
			}
		}
		if ($this->acceptTime) {
			if (isset($this->rawData['acceptTime']) and $this->rawData['acceptTime']) {
				$fields[] = $this->rawData['acceptTime'];
			} else {
				$fields[] = self::formatTime($this->acceptTime);
			}
		}
		if ($this->bkp) {
			$fields[] = $this->bkp;
		}
		if ($this->pkp) {
			$fields[] = $this->pkp;
		}
		if ($this->fik) {
			$fields[] = $this->fik;
		}
		if ($this->rejectTime) {
			if (isset($this->rawData['rejectTime']) and $this->rawData['rejectTime']) {
				$fields[] = $this->rawData['rejectTime'];
			} else {
				$fields[] = self::formatTime($this->rejectTime);
			}
		}
		if ($this->error) {
			$fields[] = $this->error->getSignatureBase();
		}
		if ($this->warning) {
			foreach ($this->warning as $w) {
				$fields[] = $w->getSignatureBase();
			}
		}

		return implode('|', $fields);
	}
419922
public function toBinary()
    {
        $bytes = '';

        foreach (str_split($this->value, 8) as $piece) {
            $bytes .= chr(bindec($piece));
        }

        return $bytes;
    }
875857
protected function getEncryptedEntity()
    {
        return utf8_encode(Yii::$app->getSecurity()->encryptByKey(Json::encode([
            'entity' => $this->entity,
            'entityId' => $this->entityId,
            'relatedTo' => $this->relatedTo,
        ]), $this->getModule()->id));
    }
392284
public function getVerifier()
    {
        if ( ! empty($this->key) && ! empty($this->secret)) {
            $key = rawurlencode($this->key);
            $secret = rawurlencode($this->secret);

            return base64_encode($key . ':' . $secret);
        }

        return false;
    }
1174607
public function getCepCidadeUf()
    {
        $dados = array_filter(array($this->getCep(), $this->getCidade(), $this->getUf()));
        return implode(' - ', $dados);
    }