From 6d510173d3708e32eb635aac6c3cf7c616d5be4c Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" <110212804+fryorcraken@users.noreply.github.com> Date: Wed, 3 Aug 2022 18:17:52 +1000 Subject: [PATCH] feat: remove unnecessary direct dependency (#92) Remove `iso-random-stream` direct dependency, use `randomBytes` API from `@libp2p/crypto` instead. `iso-random-stream` brings in `buffer` dependency which then needs to be polyfilled when targeting the browser. --- package.json | 1 - src/utils.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 20fa570dcf..45f4c756c0 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,6 @@ "@multiformats/multiaddr": "^10.2.0", "abortable-iterator": "^4.0.2", "err-code": "^3.0.1", - "iso-random-stream": "^2.0.0", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.3", "it-pushable": "^3.0.0", diff --git a/src/utils.ts b/src/utils.ts index c67ebdc716..cf4ba61005 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -import { randomBytes } from 'iso-random-stream' +import { randomBytes } from '@libp2p/crypto' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { sha256 } from 'multiformats/hashes/sha2'