Code Duplication    Length = 7-7 lines in 2 locations

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

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

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

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