Skip to content

Commit

Permalink
feat: remove unnecessary direct dependency (#303)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
D4nte committed Jul 20, 2022
1 parent 2b0a069 commit 77baa6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"abortable-iterator": "^4.0.2",
"denque": "^1.5.0",
"err-code": "^3.0.1",
"iso-random-stream": "^2.0.2",
"it-length-prefixed": "^7.0.1",
"it-pipe": "^2.0.3",
"it-pushable": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/buildRawMessage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { randomBytes } from 'iso-random-stream'
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { unmarshalPublicKey } from '@libp2p/crypto/keys'
import { randomBytes } from '@libp2p/crypto'
import { peerIdFromBytes } from '@libp2p/peer-id'
import type { PublicKey } from '@libp2p/interface-keys'
import type { PeerId } from '@libp2p/interface-peer-id'
Expand Down

0 comments on commit 77baa6e

Please sign in to comment.