private function getStreamHash($stream, $hash = 'md5')
    {
        $hc = hash_init($hash);
        hash_update_stream($hc, $stream);
        return hash_final($hc);
    }
private function getStreamHash($stream, $hash = 'md5')
    {
        $hc = hash_init($hash);
        hash_update_stream($hc, $stream);
        return hash_final($hc);
    }
private function getStreamHash ( $ stream , $ hash = 'md5' ) { $ hc = hash_init ( $ hash ) ; hash_update_stream ( $ hc , $ stream ) ; return hash_final ( $ hc ) ; }
Calculates hash for given stream
@param $stream
@param string $hash
@return string
Calculates hash for given stream