New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-modpow

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-modpow

export native BigInteger.modPow() function that will not freeze your UX for more than a minute.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160
decreased by-58.01%
Maintainers
3
Weekly downloads
 
Created
Source

react-native-modpow

Export native BigInteger.modPow() function that will not freeze your UX for more than a minute.

Installation

npm install react-native-modpow

Linking:

react-native link react-native-modpow

Usage

import modPow from 'react-native-modpow'

const result = modPow({
  target: 2, // number
  value: 2, // power
  modifier: 3 // Congruence
})
// result = 0

Usage as patch for Forge

Use this snippet to patch BigInteger.modPow() from node-forge. The goal is to improve Forge's performance on React-Native significantly, in particular the generation of RSA keys.

import Forge from 'node-forge'
import modPow from 'react-native-modpow'

Forge.jsbn.BigInteger.prototype.modPow = function nativeModPow (e, m) {
  const result = modPow({
    target: this.toString(16),
    value: e.toString(16),
    modifier: m.toString(16)
  })

  return new Forge.jsbn.BigInteger(result, 16)
}

Keywords

FAQs

Package last updated on 02 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc