Skip to content

feat(hash): expose incremental hashing to standalone Nitro v1 - #1099

Closed
hannojg wants to merge 1 commit into
mainfrom
feat/nitro-v1-hash
Closed

hannojg wants to merge 1 commit into
mainfrom
feat/nitro-v1-hash

Conversation

@hannojg

@hannojg hannojg commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

A standalone Hermes app importing multiformats/hashes/sha2 needs Node's createHash(). Quick Crypto already implements the hash in C++, but its JS entry point and generated bindings depend on React Native and Nitro 0.x.

This adds quick-crypto-nitro, a separate package exposing incremental hashing through Nitro v1. Both bindings use the same OpenSSL digest operations. The Apple target uses Quick Crypto’s existing prefixed OpenSSL archive. Android links static OpenSSL into a separate shared library because the host’s networking library also defines symbols such as ERR_get_error.

I ran the unmodified multiformats@13.4.2 SHA-256 and SHA-512 exports on Hermes on an Android 15 emulator and an iOS 27 simulator. Both produced the expected digests for a sliced typed array and supported incremental SHA-256 through node:crypto. The Android test also covers empty input and reuse after finalization. This first port covers createHash, update and digest.

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-quick-crypto Ready Ready Preview Nov 26, 2026 1:37pm UTC

Request Review

@hannojg

hannojg commented Nov 27, 2026 •

Copy link
Copy Markdown
Member Author

Two things:

  • we need to upgrade this lib to nitro v1
  • for reusing this in some other nitro related frameworks that are not RN, it would be nice to have a core package, and have the react-native integration separately

Besides the naming and implementation my agent took so far, do you think this is something we could prepare on a next branch @boorad ?

@boorad

boorad commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks @hannojg. This PR kicked off the whole plan. Closing it in favour of the Nitro Modules v1 + RN-free RNQC milestone, so one react-native-quick-crypto package serves React Native and bare Nitro Modules v1 hosts instead of a separate quick-crypto-nitro package. The decisions are in #1100.

We tested this PR's package inside the Nitro Modules v1 RN 0.88 example app. It works there with a thin React Native layer (results). Pieces from this PR carried forward:

The branch stays available for reference.

This branch was successfully deployed

1 active deployment
Preview — 3f0ebd60 Deployed Nov 26, 2026 by vercel[bot]
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.

2 participants