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

Expose checksum from zip archive. #307

Closed
mw-cwilcox opened this issue Oct 16, 2018 · 5 comments
Closed

Expose checksum from zip archive. #307

mw-cwilcox opened this issue Oct 16, 2018 · 5 comments
Assignees

Comments

@mw-cwilcox
Copy link
Contributor

I'm requesting an enhancement, to expose a checksum of the bundle data.

Motivation

My team is using CppMicroServices in deployment where DLLs may be loaded, unloaded, and reloaded through the process lifetime, and would like to utilize a checksum to know if a bundle has changed from a prior load. There is already a 'crc32' in the zip-data, so this seems straightforward to implement.

Approach

  • ('miniz.c' provides 'struct mz_zip_archive_file_stat', which has-a 'mz_uint32 m_crc32;' and is always set in 'mz_zip_reader_file_stat')
  • Add a new field to 'BundleResourceContainer::Stat', perhaps 'uint32_t crc32', or 'unsigned int checksum'; the field would be assigned by 'BundleResourceContainer::GetStat', which already has the value inside 'struct mz_zip_archive_file_stat'.
  • Add a new getter to 'BundleResource', such as 'uint32_t GetCrc32() const;' or 'unsigned int GetChecksum() const;'.

Branch

I intend to prototype exactly what I described here on a fork in a feature branch.

@mw-cwilcox
Copy link
Contributor Author

mw-cwilcox commented Oct 16, 2018

Here's what I was thinking, using 'uint32_t' for the type, and 'GetCrc32' for the method name.
development...mw-cwilcox:307-bundle-crc32

@ksubramz
Copy link
Contributor

Thanks Charles. The motivation and the changes you made in your feature branch look fine to me. I am awaiting feedback from other core developers.

@jeffdiclemente
Copy link
Member

@mw-cwilcox looks good to me. please go ahead and issue a PR to the CppMicroServices development branch.

If you could also add the contents of this issue as a RFC, using the process in https://github.com/CppMicroServices/rfcs, that would be very helpful.

Thanks!

@mw-cwilcox
Copy link
Contributor Author

Krish and Jeff,

I've created the PR #308.

Let me know if you need any other information.

Thanks!

@jeffdiclemente
Copy link
Member

Fixed in #308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants