vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
719 stars 178 forks source link

Adding findByteRange helper #100

Closed waaronking closed 4 years ago

waaronking commented 4 years ago

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 commented 4 years ago

Pull Request Test Coverage Report for Build 329


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

💛 - Coveralls
waaronking commented 4 years ago

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.

waaronking commented 4 years ago

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