Skip to content

Refactor Node.js API to use Uint8Array for data handling - #45

Merged
pentateu merged 2 commits into
mainfrom
replace_buffer_with_Uint8Array_napi
Sep 1, 2025
Merged

Refactor Node.js API to use Uint8Array for data handling#45
pentateu merged 2 commits into
mainfrom
replace_buffer_with_Uint8Array_napi

Conversation

@pentateu

@pentateu pentateu commented Sep 1, 2025

Copy link
Copy Markdown
Contributor
  • Updated method signatures in the Keys and Transport classes to replace Buffer with Uint8Array, enhancing consistency in data types across the API.
  • Modified encryption and decryption methods to utilize Uint8Array, improving performance and compatibility with modern JavaScript practices.
  • Adjusted TypeScript definitions to reflect the changes in method signatures, ensuring alignment with the updated Rust implementation.
  • Enhanced overall code clarity and maintainability by streamlining data handling processes in the API.

- Updated method signatures in the `Keys` and `Transport` classes to replace `Buffer` with `Uint8Array`, enhancing consistency in data types across the API.
- Modified encryption and decryption methods to utilize `Uint8Array`, improving performance and compatibility with modern JavaScript practices.
- Adjusted TypeScript definitions to reflect the changes in method signatures, ensuring alignment with the updated Rust implementation.
- Enhanced overall code clarity and maintainability by streamlining data handling processes in the API.
- Updated comprehensive API, lifecycle, cross-platform, and basic tests to replace Buffer checks with Uint8Array validations, enhancing consistency in data type handling.
- Introduced a new utility function, `uint8ArrayEquals`, for comparing Uint8Array instances, improving code clarity and maintainability.
- Adjusted assertions across multiple test files to ensure proper validation of cryptographic keys and encrypted data, aligning with recent API changes.
- Enhanced overall test coverage and robustness by ensuring all relevant tests reflect the updated data handling practices.
@pentateu
pentateu merged commit db870b7 into main Sep 1, 2025
1 check passed
@pentateu
pentateu deleted the replace_buffer_with_Uint8Array_napi branch September 1, 2025 09:06
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.

1 participant