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

feat: Add compact protobuf format #76

Closed mkg20001 closed 5 years ago

mkg20001 commented 6 years ago

This adds a significantly smaller (about 30%) protobuf format It's smaller because .toJSON() encodes the binary keys as base64 which makes it bigger and is sometimes not needed - like when transferring the id over the network Additionally an excludePriv option is added because the removal of the private key is not as easy as in json

daviddias commented 6 years ago

Why not use CBOR?

mkg20001 commented 6 years ago

Hmmm... which one is smaller?

mkg20001 commented 6 years ago

@pgte Requested changes applied. Could you please re-review?

pgte commented 6 years ago

Also, Travis CI is complaining..

mkg20001 commented 6 years ago

@pgte Applied requested changes, additionally fixed some other things

pgte commented 6 years ago

@mkg20001 great, thank you! CI is complaining, could you check that?

mkg20001 commented 6 years ago

@pgte Yes, although it's unclear to me what exactly is wrong with the commit message. It only shows it's not in the required format, not where exactly the error is

pgte commented 6 years ago

@VictorBjelkholm could you help clarifying this question about the commit message?

mkg20001 commented 5 years ago

Updated this PR to async/await

mkg20001 commented 5 years ago

@jacobheun Thx, changes commited

jacobheun commented 5 years ago

released in 0.13.2

mkg20001 commented 5 years ago

Nice :tada: