Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ChecksumCalculator Interface #594

Merged
merged 2 commits into from
Dec 13, 2018
Merged

Implement ChecksumCalculator Interface #594

merged 2 commits into from
Dec 13, 2018

Conversation

damijank
Copy link
Contributor

If an application is handling videos, the method to download the file locally and calculate the MD5 hash is not feasible. Azure calculates the MD5 hash, this PR implements fetching MD5 info from Azure.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@dkarlovi
Copy link
Contributor

Closes #590.

@nicolasmure
Copy link
Contributor

Hello @damijank :)

Thank you for your contribution, do you mind to add a test covering your changes ?

Thanks ;)

@damijank
Copy link
Contributor Author

@nicolasmure there's the test case :)

$this->filesystem->write($path, $content);
$checksumBase64 = $this->filesystem->checksum($path);

$this->assertEquals(\md5($content), \bin2hex(\base64_decode($checksumBase64, true)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to get your test here. Why to call again bin2hex and base64_decode ?
Shouldn't the test be

$checksum = $this->filesystem->checksum($path);
$this->assertEquals(\md5($content), $checksum);

?

Copy link
Contributor Author

@damijank damijank Dec 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, you are right. I was too quick with this. Sending fix right away.

@nicolasmure
Copy link
Contributor

Thank you @damijank !

@nicolasmure nicolasmure merged commit 7a92aba into KnpLabs:master Dec 13, 2018
@damijank damijank deleted the patch-1 branch December 13, 2018 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants