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

Provide feature of extracting Raw Data #29

Closed
wants to merge 9 commits into from
Closed

Provide feature of extracting Raw Data #29

wants to merge 9 commits into from

Conversation

erion-leka
Copy link
Contributor

There is no method of getting the uncorrected and unmasked raw data of a QR- Code, as these steps are done in encapsulated in one method, thus not exposing Raw Data. However, there should be a public getter Method for it.
It would benefit the library for offering it, as one has more freedom to inspect read data.

This pull request to src/decode.rs and src/lib.rs introduces several changes to enhance functionality and improve code readability. The most important changes include making the data field in RawData public, adding a new method to extract raw data from a QR code, and modifying existing functions to handle an optional mask removal.

Functionality Enhancements:

  • src/decode.rs: Added a new method get_raw to extract raw data from a QR code.
  • src/lib.rs: Added a new method get_raw_data to the public API to expose the get_raw functionality.

Code Modifications:

  • src/decode.rs: Modified read_data and read_bit functions to handle an optional remove_mask parameter. [1] [2] [3]
  • src/decode.rs: Made the data field in RawData public to allow external access.

Minor Changes:

@WanzenBug
Copy link
Owner

Please rebase and fix the formatting. Then I'll happily merge this.

@erion-leka erion-leka closed this Oct 6, 2024
@erion-leka erion-leka reopened this Oct 6, 2024
erion-leka and others added 9 commits October 7, 2024 00:35
Making the constant MAX_PAYLOAD_SIZE public, would allow the  expansion of structs, like DataStream, in another crate. Even though DataStream is declared public, having the private  constant as an attribute, makes it not possible to access it directly from another crate.

This small change would make expanding functionality much easier.
@erion-leka
Copy link
Contributor Author

Im sorry if I caused some chaos, but is it now appropriate?

@WanzenBug
Copy link
Owner

If squashed all commits and added some docs in be6202c

@WanzenBug WanzenBug closed this Oct 7, 2024
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.

2 participants