Skip to content

Commit

Permalink
Merge pull request #2 from kduma/analysis-XanrYx
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
kduma authored Dec 2, 2016
2 parents 11a60e4 + 1c18dd1 commit 552a23f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public static function file($hash_file)
public static function stream($stream, $checksums_string)
{
$sha1 = hash_init('sha1');
$md5 = hash_init('md5');
$md5 = hash_init('md5');

while ($buffer = fread($stream, 1024)) {
hash_update($sha1, $buffer);
hash_update($md5, $buffer);
}

$sha1 = hash_final($sha1);
$md5 = hash_final($md5);
$md5 = hash_final($md5);

$hashes = (new Unpacker())->unpack($checksums_string);

Expand Down
4 changes: 2 additions & 2 deletions src/Hasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public static function file($real_file)
public static function stream($stream)
{
$sha1 = hash_init('sha1');
$md5 = hash_init('md5');
$md5 = hash_init('md5');

while ($buffer = fread($stream, 1024)) {
hash_update($sha1, $buffer);
hash_update($md5, $buffer);
}

$sha1 = hash_final($sha1);
$md5 = hash_final($md5);
$md5 = hash_final($md5);

return (new Packer())->pack(['sha1' => $sha1, 'md5' => $md5]);
}
Expand Down

0 comments on commit 552a23f

Please sign in to comment.