We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Utilize stream filters to verify the content of stream.
For example an md5 verification:
class MD5 extends \php_user_filter { private $context; public function onCreate() { $this->context = hash_init('md5'); return true; } public function onClose() { $hash = hash_final($this->context); if (false === hash_equals($this->params, $hash)) { throw new VerificationException('The stream integrity cannot be verified'); } return true; } public function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { hash_update($this->context, $bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } }
This would be useful when downloading files (PHARs for example, when a hash is likely available)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Utilize stream filters to verify the content of stream.
For example an md5 verification:
This would be useful when downloading files (PHARs for example, when a hash is likely available)
The text was updated successfully, but these errors were encountered: