Code Duplication    Length = 7-7 lines in 2 locations

lib/private/Files/Storage/Common.php 1 location

@@ 238-244 (lines=7) @@
235
		}
236
	}
237
238
	public function hash($type, $path, $raw = false) {
239
		$fh = $this->fopen($path, 'rb');
240
		$ctx = hash_init($type);
241
		hash_update_stream($ctx, $fh);
242
		fclose($fh);
243
		return hash_final($ctx, $raw);
244
	}
245
246
	public function search($query) {
247
		return $this->searchInDir($query);

lib/private/Files/Storage/Wrapper/Encryption.php 1 location

@@ 820-826 (lines=7) @@
817
	 * @param bool $raw
818
	 * @return string
819
	 */
820
	public function hash($type, $path, $raw = false) {
821
		$fh = $this->fopen($path, 'rb');
822
		$ctx = hash_init($type);
823
		hash_update_stream($ctx, $fh);
824
		fclose($fh);
825
		return hash_final($ctx, $raw);
826
	}
827
828
	/**
829
	 * return full path, including mount point