Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 244-250 (lines=7) @@
241
		}
242
	}
243
244
	public function hash($type, $path, $raw = false) {
245
		$fh = $this->fopen($path, 'rb');
246
		$ctx = \hash_init($type);
247
		\hash_update_stream($ctx, $fh);
248
		\fclose($fh);
249
		return \hash_final($ctx, $raw);
250
	}
251
252
	public function search($query) {
253
		return $this->searchInDir($query);

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

@@ 861-867 (lines=7) @@
858
	 * @param bool $raw
859
	 * @return string
860
	 */
861
	public function hash($type, $path, $raw = false) {
862
		$fh = $this->fopen($path, 'rb');
863
		$ctx = \hash_init($type);
864
		\hash_update_stream($ctx, $fh);
865
		\fclose($fh);
866
		return \hash_final($ctx, $raw);
867
	}
868
869
	/**
870
	 * return full path, including mount point