mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-07-07 19:01:54 +00:00
Async Crypto Endeavour (#33)
* refactor: make import and creation async - This allows the use of native key generation in the browser BREAKING CHANGE: This changes the interface of .create, .createFromPrivKey, .createFromPubKey, .createFromJSON
This commit is contained in:
committed by
David Dias
parent
e08907ff94
commit
31701e236d
@ -4,4 +4,10 @@
|
||||
|
||||
const PeerId = require('./index.js')
|
||||
|
||||
console.log(JSON.stringify(PeerId.create().toJSON(), null, ' '))
|
||||
PeerId.create((err, id) => {
|
||||
if (err) {
|
||||
throw err
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(id.toJSON(), null, 2))
|
||||
})
|
||||
|
Reference in New Issue
Block a user