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

Adding findByteRange helper #100

Merged
merged 4 commits into from
Sep 17, 2020
Merged

Adding findByteRange helper #100

merged 4 commits into from
Sep 17, 2020

Conversation

waaronking
Copy link
Contributor

Per #98, this PR adds a findByteRange that properly parses the ByteRange field regardless of the spacing included inside.

The function returns a byteRangePlaceholder (if it exists), a byteRangeStrings array containing each byteRangeString in the pdf, and a byteRanges array of values for each byteRangeString. I've updated the PR to support multiple byteRanges per PDF.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 329

  • 14 of 14 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 325: 0.0%
Covered Lines: 303
Relevant Lines: 303

💛 - Coveralls

@waaronking
Copy link
Contributor Author

Per the requirements for this PR, only byteRangePlaceholder was required, but since the other data was easily accessible, I added byteRangeStrings and byteRanges that could be used to refactor/replace some of the logic in https://github.com/vbuch/node-signpdf/blob/develop/src/helpers/extractSignature.js at some point in the future.

Copy link
Owner

@vbuch vbuch left a comment

Choose a reason for hiding this comment

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

Great contribution!

@vbuch vbuch merged commit ac7f496 into vbuch:develop Sep 17, 2020
@waaronking
Copy link
Contributor Author

Thank you! And thanks for all the work you've put into this project!

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.

3 participants