Refactor SenderKeyMessage to use static signature length#2301
Refactor SenderKeyMessage to use static signature length#2301Kunboruto20 wants to merge 1 commit intoWhiskeySockets:masterfrom
Conversation
|
Thanks for opening this pull request and contributing to the project! The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch. In the meantime, anyone in the community is encouraged to test this pull request and provide feedback. ✅ How to confirm it worksIf you’ve tested this PR, please comment below with: This helps us speed up the review and merge process. 📦 To test this PR locally:If you encounter any issues or have feedback, feel free to comment as well. |
|
One more time? #2220 (comment) |
Is there anything relevant that could be used? Extracted into a separate PR that makes sense? |
|
This PR is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days |
This PR refactors the SenderKeyMessage class to make it easier to work with and more consistent across environments.
Changes include:
Internal fields now consistently use Uint8Array instead of mixing Buffer and Uint8Array, making it compatible with both Node and browsers.
Added a toJSON() method for quick inspection and logging of the message content.
Added verifySignatureAsync() for async-friendly signature verification that returns a boolean instead of throwing.
Retained the original verifySignature() behavior for backwards compatibility.
Introduced helper methods for safely handling base64/hex conversions and concatenating byte arrays.