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

@@ 867-873 (lines=7) @@
864
	 * @param bool $raw
865
	 * @return string
866
	 */
867
	public function hash($type, $path, $raw = false) {
868
		$fh = $this->fopen($path, 'rb');
869
		$ctx = hash_init($type);
870
		hash_update_stream($ctx, $fh);
871
		fclose($fh);
872
		return hash_final($ctx, $raw);
873
	}
874
875
	/**
876
	 * return full path, including mount point