src/UploadedFile.php
public function getHash($algo = 'sha1')
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        return hash_file($algo, $this->file);
    }
public function getHash($algo = 'sha1')
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        return hash_file($algo, $this->file);
    }
Retrieve the hash value using the contents of file.

@param string $algo Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..)

@return string
@throws \RuntimeException on any error during the hash operation.

@see \hash_file()