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

Improve the implementation of the PDFDocument.fingerprints-getter #17862

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Oct 14, 2024

  1. Improve the implementation of the PDFDocument.fingerprints-getter

     - Add explicit `length` validation of the /ID entries. Given the `EMPTY_FINGERPRINT` constant we're already *implicitly* assuming a particular length.
    
     - Move the constants into the `fingerprints`-getter, since they're not used anywhere else.
    
     - Replace the `hexString` helper function with the standard `Uint8Array.prototype.toHex` method; see https://github.com/tc39/proposal-arraybuffer-base64
    Snuffleupagus committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    38d14fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6114dcd View commit details
    Browse the repository at this point in the history
  3. Add helper functions to allow using new Uint8Array methods

    This allows using the new methods in browsers that support them, e.g. Firefox 133+, while still providing fallbacks where necessary; see https://github.com/tc39/proposal-arraybuffer-base64
    
    *Please note:* These are not actual polyfills, but only implements what we need in the PDF.js code-base. Eventually this patch should be reverted, once support is generally available.
    Snuffleupagus committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    2598a0b View commit details
    Browse the repository at this point in the history