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

@polkadot/x-randomvalues

Package Overview
Dependencies
Maintainers
2
Versions
725
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/x-randomvalues - npm Package Compare versions

Comparing version 4.0.0-9 to 4.0.0-10

fallback.spec.d.ts

4

fallback.js

@@ -23,7 +23,7 @@ "use strict";

for (let i = 0; i < arr.length; i++) {
if ((i & 0x03) === 0) {
if ((i & 0b11) === 0) {
r = Math.random() * 0x100000000;
}
arr[i] = r >>> ((i & 0x03) << 3) & 0xff;
arr[i] = r >>> ((i & 0b11) << 3) & 0xff;
}

@@ -30,0 +30,0 @@

{
"name": "@polkadot/x-randomvalues",
"version": "4.0.0-9",
"version": "4.0.0-10",
"description": "A cross-environment window.crypto.getRandomValues replacement",

@@ -5,0 +5,0 @@ "browser": "browser.js",

@@ -1,3 +0,3 @@

declare function getRandomValuesGlobal<T extends Uint8Array>(arr: T): T;
declare const _default: typeof getRandomValuesGlobal;
import insecureRandomValues from './fallback';
declare const _default: typeof insecureRandomValues;
export default _default;

@@ -20,5 +20,2 @@ "use strict";

function getRandomValuesNative(arr) {
// We may want to use a base64 decoder here, but we certainly have an issue where we
// want/need this part as lean as possible. Since Buffer is already needed elsewhere
// (an generally prevalent in JS), we rather use it as-is.
return Buffer.from(_reactNative.NativeModules.RNGetRandomValues.getRandomBase64(arr.length), 'base64').reduce((arr, byte, index) => {

@@ -25,0 +22,0 @@ arr[index] = byte;

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