🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@libp2p/crypto

Package Overview
Dependencies
Maintainers
6
Versions
857
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/crypto - npm Package Compare versions

Comparing version
5.1.19
to
5.1.20
+2
-0
dist/src/random-bytes.d.ts
/**
* Generates a Uint8Array with length `number` populated by random bytes
*
* @deprecated use `crypto.getRandomValues()` instead
*/
export default function randomBytes(length: number): Uint8Array;
//# sourceMappingURL=random-bytes.d.ts.map
+1
-1

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

{"version":3,"file":"random-bytes.d.ts","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAK/D"}
{"version":3,"file":"random-bytes.d.ts","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAK/D"}
import { InvalidParametersError } from '@libp2p/interface';
import { randomBytes as randB } from '@noble/hashes/utils.js';
/**
* Generates a Uint8Array with length `number` populated by random bytes
*
* @deprecated use `crypto.getRandomValues()` instead
*/

@@ -10,4 +11,4 @@ export default function randomBytes(length) {

}
return randB(length);
return crypto.getRandomValues(new Uint8Array(length));
}
//# sourceMappingURL=random-bytes.js.map

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

{"version":3,"file":"random-bytes.js","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAc;IACjD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,sBAAsB,CAAC,oDAAoD,CAAC,CAAA;IACxF,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC"}
{"version":3,"file":"random-bytes.js","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAc;IACjD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,sBAAsB,CAAC,oDAAoD,CAAC,CAAA;IACxF,CAAC;IACD,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;AACvD,CAAC"}
{
"name": "@libp2p/crypto",
"version": "5.1.19",
"version": "5.1.20",
"description": "Crypto primitives for libp2p",

@@ -93,8 +93,8 @@ "license": "Apache-2.0 OR MIT",

"dependencies": {
"@libp2p/interface": "^3.2.3",
"@libp2p/interface": "^3.2.4",
"@noble/curves": "^2.0.1",
"@noble/hashes": "^2.0.1",
"multiformats": "^14.0.0",
"protons-runtime": "^6.0.1",
"uint8arraylist": "^2.4.8",
"protons-runtime": "^7.0.0",
"uint8arraylist": "^3.0.2",
"uint8arrays": "^6.1.1"

@@ -107,3 +107,3 @@ },

"benchmark": "^2.1.4",
"protons": "^8.1.1"
"protons": "^9.0.1"
},

@@ -110,0 +110,0 @@ "browser": {

import { InvalidParametersError } from '@libp2p/interface'
import { randomBytes as randB } from '@noble/hashes/utils.js'
/**
* Generates a Uint8Array with length `number` populated by random bytes
*
* @deprecated use `crypto.getRandomValues()` instead
*/

@@ -11,3 +12,3 @@ export default function randomBytes (length: number): Uint8Array {

}
return randB(length)
return crypto.getRandomValues(new Uint8Array(length))
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display