WordPress at a glance
function is not described

ParagonIE_Sodium_File::updateHashWithFile() public WP 1.0

Update a hash context with the contents of a file, without loading the entire file into memory.

{} It's a method of the class: ParagonIE_Sodium_File{}

No Hooks.

Return

resource|Object. Resource on PHP < 7.2, HashContext object on PHP >= 7.2

Usage

$result = ParagonIE_Sodium_File::updateHashWithFile( $hash, $fp, $size );
$hash *(resource object) (required)*
$fp(resource) (required)
-
$size(int)
-

Code of ParagonIE_Sodium_File::updateHashWithFile() WP 5.7

<?php
public static function updateHashWithFile($hash, $fp, $size = 0)
{
    /* Type checks: */
    if (PHP_VERSION_ID < 70200) {
        if (!is_resource($hash)) {
            throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.');
        }
    } else {
        if (!is_object($hash)) {
            throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.');
        }
    }

    if (!is_resource($fp)) {
        throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.');
    }
    if (!is_int($size)) {
        throw new TypeError('Argument 3 must be an integer, ' . gettype($size) . ' given.');
    }

    /** @var int $originalPosition */
    $originalPosition = self::ftell($fp);

    // Move file pointer to beginning of file
    fseek($fp, 0, SEEK_SET);
    for ($i = 0; $i < $size; $i += self::BUFFER_SIZE) {
        /** @var string|bool $message */
        $message = fread(
            $fp,
            ($size - $i) > self::BUFFER_SIZE
                ? $size - $i
                : self::BUFFER_SIZE
        );
        if (!is_string($message)) {
            throw new SodiumException('Unexpected error reading from file.');
        }
        /** @var string $message */
        /** @psalm-suppress InvalidArgument */
        hash_update($hash, $message);
    }
    // Reset file pointer's position
    fseek($fp, $originalPosition, SEEK_SET);
    return $hash;
}