YoastSEO_Vendor\GuzzleHttp\Psr7
hash() Yoast 1.0
Calculate a hash of a Stream
Хуков нет.
Возвращает
Строку. Returns the hash of the stream
Использование
hash( \YoastSEO_Vendor\Psr\Http\Message\StreamInterface $stream, $algo, $rawOutput );
- $stream(Streamчислоerface) (обязательный)
- Stream to calculate the hash for
- $algo(строка) (обязательный)
- Hash algorithm (e.g. md5, crc32, etc)
- $rawOutput(true/false)
- Whether or not to use raw output
По умолчанию: \false
Код hash() hash Yoast 15.6.2
function hash(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $stream, $algo, $rawOutput = \false)
{
$pos = $stream->tell();
if ($pos > 0) {
$stream->rewind();
}
$ctx = \hash_init($algo);
while (!$stream->eof()) {
\hash_update($ctx, $stream->read(1048576));
}
$out = \hash_final($ctx, (bool) $rawOutput);
$stream->seek($pos);
return $out;
}