@libp2p/crypto
Advanced tools
| /** | ||
| * 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 +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"} |
+5
-5
| { | ||
| "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
2
-33.33%1236617
-7.35%5952
-1.08%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated