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

@helium/crypto-react-native

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helium/crypto-react-native - npm Package Compare versions

Comparing version 3.9.0 to 3.43.1

5

build/Keypair.js

@@ -31,3 +31,3 @@ "use strict";

const entropy = mnenomic.toEntropy();
const seed = Buffer.concat([entropy, entropy]);
const seed = entropy.length === 16 ? Buffer.concat([entropy, entropy]) : entropy;
return Keypair.fromEntropy(seed);

@@ -37,4 +37,5 @@ }

const entropyBuffer = Buffer.from(entropy);
if (Buffer.byteLength(entropyBuffer) !== 32)
if (Buffer.byteLength(entropyBuffer) !== 32) {
throw new Error('Invalid entropy, must be 32 bytes');
}
const keypair = await react_native_sodium_1.default.crypto_sign_seed_keypair(entropyBuffer.toString('base64'));

@@ -41,0 +42,0 @@ return new Keypair(keypair);

@@ -21,4 +21,5 @@ "use strict";

throw new Error('invalid entropy, greater than 32');
if (entropy.length % 4 !== 0)
if (entropy.length % 4 !== 0) {
throw new Error('invalid entropy, not divisble by 4');
}
const entropyBits = utils_1.bytesToBinary([].slice.call(entropy));

@@ -53,3 +54,3 @@ const checksumBits = utils_1.deriveChecksumBits(entropy);

const newChecksum = utils_1.deriveChecksumBits(entropy);
if (newChecksum !== checksumBits)
if (checksumBits !== '0000' && newChecksum !== checksumBits)
throw new Error('invalid checksum');

@@ -56,0 +57,0 @@ return entropy;

4

package.json
{
"name": "@helium/crypto-react-native",
"version": "3.9.0",
"version": "3.43.1",
"description": "Cryptography utilities including mnemonics, keypairs and base58-check encoding for React Native",

@@ -39,3 +39,3 @@ "keywords": [

},
"gitHead": "299f2c790fbca9461265b94695c7ab816abc7f9d"
"gitHead": "795bf010b6f233703ef9eab1df45f24fb3253553"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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