Major refactor: performance optimization, security hardening, and testing #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive improvements to the PDF library, focusing on modernizing the codebase, enhancing security and performance, and improving testing and CI practices. Key changes include a major update to the documentation, the addition of advanced benchmark and security corpus tests, and the introduction of a GitHub Actions CI workflow. Several new test files have been added to ensure correctness and robustness of encryption and filter logic.
Documentation and Project Metadata Updates:
README.mdto document the library's new high-performance, zero-allocation AST, improved security features (AES-128/256 support), robust error handling, memory efficiency, and benchmark results.go.modto define the module path asgithub.com/digitorus/pdfand set Go version to 1.23.Continuous Integration and Testing:
.github/workflows/ci.yml) to automate testing, security corpus validation, and cross-platform builds for multiple OS/architectures.Benchmarking and Security Testing:
benchmark_test.goto provide benchmarks for object resolution and full object parsing, enabling performance regression tracking.corpus_test.goto enable large-scale security and robustness testing using PDF Association corpora, with support for automatic corpus downloading and panic recovery to ensure no malformed input can crash the library.Unit Testing for Core Features:
encryption_test.gowith comprehensive tests for cryptographic key derivation, RC4/AES decryption, PDF 2.0 authentication, and stream decryption logic.filter_test.goto verify the correctness of core PDF stream filters (ASCIIHexDecode, ASCII85Decode, FlateDecode).