@param bool $rawBinary
@return string

@throws \SodiumException
489309
public function getHash(bool $rawBinary = false): string
    {
        if (empty($this->hash)) {
            $this->hash = SodiumCompat::crypto_generichash(
                $this->data,
                $this->prevHash,
                Blakechain::HASH_SIZE
            );
        }
        if ($rawBinary) {
            return $this->hash;
        }
        return Base64UrlSafe::encode($this->hash);
    }
609239
public function getData($raw = false)
    {
        if (true === $raw) {
            return $this->data;
        }

        $this->prepare();

        return $this->dataPrepared;
    }
743140
public function getAssetUrl($raw = false)
    {
        if ($this->assetUrl === null) {
            $this->assetUrl = Yii::$app->assetManager->publish(
                $this->getBasePath() . '/' . $this->distDir
            );
        }
        return $raw ? $this->assetUrl : $this->assetUrl[1];
    }
104404
public function getBinaryMessage()
    {
        $encodedPayload = $this->jsonEncode($this->payload->getPayload());

        return chr(0).
               chr(0).
               chr(32).
               pack('H*', $this->deviceToken).
               chr(0).chr(strlen($encodedPayload)).
               $encodedPayload;
    }
1251264
private function normalizeBinaryAnnotation(BinaryAnnotation $binaryAnnotation)
    {
        $normalizedAnnotation = [
            'key' => $binaryAnnotation->getKey(),
            'value' => (string) $binaryAnnotation->getValue(),
        ];

        if (null !== ($host = $binaryAnnotation->getHost())) {
            $normalizedAnnotation['endpoint'] = $this->normalizeEndpoint($host);
        }

        return $normalizedAnnotation;
    }
1022654
public function getBinary()
    {
        $sid = explode('-', ltrim($this->value, 'S-'));

        $level = (int) array_shift($sid);

        $authority = (int) array_shift($sid);

        $subAuthorities = array_map('intval', $sid);

        $params = array_merge(
            ['C2xxNV*', $level, count($subAuthorities), $authority],
            $subAuthorities
        );

        return call_user_func_array('pack', $params);
    }
841286
public function decodeVendorSpecificContent($rawValue)
    {
        $result   = array();
        $offset   = 0;
        $vendorId = (ord(substr($rawValue, 0, 1)) * 256 * 256 * 256) +
                    (ord(substr($rawValue, 1, 1)) * 256 * 256) +
                    (ord(substr($rawValue, 2, 1)) * 256) +
                     ord(substr($rawValue, 3, 1));

        $offset += 4;
        while ($offset < strlen($rawValue)) {
            $vendorType        = (ord(substr($rawValue, 0 + $offset, 1)));
            $vendorLength      = (ord(substr($rawValue, 1 + $offset, 1)));
            $attributeSpecific = substr($rawValue, 2 + $offset, $vendorLength);
            $result[]          = array($vendorId, $vendorType, $attributeSpecific);
            $offset           += $vendorLength;
        }

        return $result;
    }
611573
public function getParent($raw = true)
	{
		$return = '';

		if (isset($this->dirname))
		{
			$return = $this->dirname;
		}
		else if ($path = $this->getPath())
		{
			$bits = explode('/', $path);
			array_pop($bits);

			if (count($bits) > 0)
			{
				$return = implode('/', $bits);
			}
		}

		return $raw ? $return : self::fromPath($return, $this->getAdapter());
	}
628722
public function getBinarySlice($binary, $start, $size, $binaryLength)
    {
        $binary >>= $binaryLength - ($start + $size);
        $mask = ((1 << $size) - 1);

        return $binary & $mask;
    }
339903
public function isBinary()
    {
        if (is_string($this->data)) {
            $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data);
            return (substr($mime, 0, 4) != 'text' && $mime != 'application/x-empty');
        }

        return false;
    }
329381
public function rawData($bool = false)
	{
		if (is_bool($bool)) {
			$this->useRawData = $bool;
		} else {
			throw new RuntimeException('Invalid parameter type, expected boolean, got ' . gettype($bool));
		}
		
		return $this;
	}
965770
public function getSize($raw = false)
	{
		if (!isset($this->size))
		{
			$this->size = $this->hasAdapterOrFail()->adapter->getSize($this->getPath());
		}

		return ($raw) ? $this->size : \Hubzero\Utility\Number::formatBytes($this->size);
	}
729308
public function buildLenEncodedBinary($s)
    {
        if ($s === null) {
            return "\251";
        }

        $l = mb_orig_strlen($s);

        if ($l <= 250) {
            return chr($l) . $s;
        }

        if ($l <= 0xFFFF) {
            return "\252" . $this->int2bytes(2, $l) . $s;
        }

        if ($l <= 0xFFFFFF) {
            return "\254" . $this->int2bytes(3, $l) . $s;
        }

        return $this->int2bytes(8, $l) . $s;
    }
1094016
public function writeBinary($message)
    {
        $final = false;
        $pos = 0;
        $totalLength = mb_strlen($message, '8bit');
        while (!$final) {
            $data = mb_substr($message, $pos, self::FRAME_SIZE, '8bit');
            $dataLength = mb_strlen($data, '8bit');
            $pos += $dataLength;
            $final = ($pos === $totalLength);
            $frame = new Net_Notifier_WebSocket_Frame(
                $data,
                Net_Notifier_WebSocket_Frame::TYPE_BINARY,
                false,
                $final
            );
            $this->send($frame->__toString());
        }
    }
288448
public static function binaryBatchUpdate(Api\MtBatchBinarySmsUpdate $batch)
    {
        $fields = Serialize::_batchUpdateHelper($batch);

        $fields['type'] = 'mt_binary';

        if (null != $batch->getBody()) {
            $fields['body'] = base64_encode($batch->getBody());
        }

        if (null != $batch->getUdh()) {
            $fields['udh'] = bin2hex($batch->getUdh());
        }

        return Serialize::_toJson($fields);
    }
457359
public function getBinary()
    {
        $default = $this->binary;

        // Resolve true path to binary
        if (!$this->resolved) {
            $paths = $this->getKnownPaths() ?: [$default];
            if ($this->connections->getCurrentConnectionKey() && $paths) {
                $binary = Arr::get($paths, 0);
                $fallback = Arr::get($paths, 1);
                $this->setBinary($this->bash->which($binary, $fallback, false));
            } elseif ($paths) {
                $this->setBinary($paths[0]);
            }
        }

        return $this->binary ?: $default;
    }
1287014
static function rawXMLText( $contentObjectAttribute )
    {
        $text = $contentObjectAttribute->attribute( 'data_text' );
        $timestamp = $contentObjectAttribute->attribute( 'data_int' );
        if ( $timestamp < self::VERSION_30_TIMESTAMP )
        {
            $charset = 'UTF-8';
            $codec = eZTextCodec::instance( false, $charset );
            $text = $codec->convertString( $text );
            $timestamp = self::VERSION_30_TIMESTAMP;
        }
        return $text;
    }