src/MediaUploader.php
private function generateHash()
    {
        $ctx = hash_init('md5');

        // We don't need to read the file contents if the source has a path
        if ($this->source->path()) {
            hash_update_file($ctx, $this->source->path());
        } else {
            hash_update($ctx, $this->source->contents());
        }

        return hash_final($ctx);
    }
private function generateHash()
    {
        $ctx = hash_init('md5');

        // We don't need to read the file contents if the source has a path
        if ($this->source->path()) {
            hash_update_file($ctx, $this->source->path());
        } else {
            hash_update($ctx, $this->source->contents());
        }

        return hash_final($ctx);
    }
private function generateHash ( ) { $ ctx = hash_init ( 'md5' ) ; // We don't need to read the file contents if the source has a path if ( $ this -> source -> path ( ) ) { hash_update_file ( $ ctx , $ this -> source -> path ( ) ) ; } else { hash_update ( $ ctx , $ this -> source -> contents ( ) ) ; } return hash_final ( $ ctx ) ; }
Calculate hash of source contents.
@return string
Calculate hash of source contents .