libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

'TypeError: this._key.encrypt is not a function' when encrypting #80

Closed mkg20001 closed 4 years ago

mkg20001 commented 6 years ago
require('peer-id').create({type: 'rsa', size: 2048}, (e, i) => {i.pubKey.encrypt(Buffer.from('data'), console.log)})

Unsure if this is my code that's broken or this library

mkg20001 commented 5 years ago

Related PR: https://github.com/libp2p/js-libp2p-crypto/pull/125