Skip to content

fix: hash/hmac string passing#856

Merged
boorad merged 2 commits into
mainfrom
fix/646
Dec 11, 2025
Merged

fix: hash/hmac string passing#856
boorad merged 2 commits into
mainfrom
fix/646

Conversation

@boorad

@boorad boorad commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

Summary of Changes for Issue #646

Problem: Hashing large strings (8MB) was taking ~3 seconds due to slow string-to-Buffer-to-ArrayBuffer conversion in TypeScript.

Solution: Modified hash.update() to accept both string and ArrayBuffer types, allowing UTF-8 strings to be passed directly to C++ via Nitro Modules without conversion.

Performance Improvement: Massive speedup - the 8MB hash now completes in milliseconds instead of seconds, exactly as predicted in the issue!

closes #646

This same fix was applied to hmac as well.

@boorad boorad self-assigned this Dec 11, 2025
@boorad

boorad commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator Author
Before After
Before After
Before After

@github-actions

github-actions Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

🤖 End-to-End Test Results - Android

Status: ✅ Passed
Platform: Android
Run: 20141355800

📸 Final Test Screenshot

Maestro Test Results - android

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@github-actions

github-actions Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

🤖 End-to-End Test Results - iOS

Status: ✅ Passed
Platform: iOS
Run: 20141355850

📸 Final Test Screenshot

Maestro Test Results - ios

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@boorad boorad changed the title fix: hash string passing fix: hash/hmac string passing Dec 11, 2025
@boorad boorad merged commit da2c37d into main Dec 11, 2025
5 of 7 checks passed
@boorad boorad deleted the fix/646 branch December 11, 2025 17:57
@mrousavy

Copy link
Copy Markdown
Member

good stuff brad!

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.

🐛 Calcuating hash of long strings is quite slow

2 participants