npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-sha

v0.1.6

Published

blazing fast SHA hashing library with direct c++ bindings

Readme

React Native SHA library⚡⚡⚡

React-native-sha is a blazing fast⚡ solution for performing Secure Hashing Algorithm in React Native. Main reason this library is incredibly fast is because it provides bindings to a C++ implementation of the hashing algorithm through the Javascript Interface (JSI).

⚠️⚠️⚠️ This library currently has support for android only. IOS developers (mainly ObjC) needed to add support for IOS.

Features

  • Support for SHA-1, SHA-256, SHA3-224, SHA3-256, SHA3-384, SHA3-512
  • Direct bindings to C++ library, hence ⚡⚡⚡
  • Synchronous function calls
  • 160x faster than current popular solutions
  • Supports compounded hashing of byte chunks
SHA256 sha256 = new SHA256();
while(data is available) {
  sha256.add(chunk, chunk size)
}

sha256.gethash(); //sha-256 of entire data

Benchmarks

alt text

alt text

alt text

alt text

alt text

alt text

Installation

Installing react-native-sha with npm

  npm install react-native-sha

JSI is still in an experimental stage and hence a little workaround is required to link the library to your project. The facebook team is working on a feature, Turbo modules which will autolink your JSI modules.

import com.facebook.react.bridge.JSIModulePackage;
import com.reactnativesha.ShaJsiPackage;


public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
      new ReactNativeHost(this) {

        ///....

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }


        // Add this method to your MainApplication

        @Nullable
        @Override
        protected JSIModulePackage getJSIModulePackage() {
          return new ShaJsiPackage();
        }
      };

API Reference

All classes implement the Hash interface.

interface HashInterface {
  getHash: () => string;
  add: (buf: ArrayBuffer, bufSize: number) => void;
  reset: () => void;
  computeHash: (text: string) => string;
}

| Function | Parameters | Description | | :-------------- | :--------------------------------- | :-------------------------------------------------------------------------------------- | | getHash() | none | Returns the latest hash as string | | add() | buf: ArrayBuffer bufSize: number | adds abitrary number of bytes as ArrayBuffer. Support for more byte formats coming soon | | reset() | none | flushes added bytes out of memory | | computeHash() | text: string | Accepts a string and returns its hash as a string |

Examples

import { SHA256 } from 'react-native-sha';
import { Buffer } from 'buffer'; //needs to be installed in RN environment
import { data } from './test.json';

const sha256 = new SHA256();
sha256.computeHash('hash the world'); //33e9b48e6afb96bc6195f02102831b37c9cebbdacf9173df1881b9a7764444ae

const dataToProcess = Buffer.from(data, 'base64').buffer; //ArrayBuffer
sha256.add(dataToProcess, dataToProcess.byteLength);
sha256.getHash(); // hash of data

sha256.reset(); //flushes hash out of memory

SHA-3 with different variants

const sha3_256 = new SHA3('256');
sha3_256.computeHash('hash the world'); //623734226db189364e8a996cf05936b1b42cd8cfc9247040fd61d571

// same api as rest of the classes

Credits

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

License

MIT