17 Commits

Author SHA1 Message Date
Alex Potsides
d16ce9c2ac
fix: replace node buffers with uint8arrays (#127)
* fix: replace node buffers with uint8arrays

Replaces all uses of node Buffers with Uint8Arrays

BREAKING CHANGES:

- Where node Buffers were returned, now Uint8Arrays are

* chore: remove gh dep
2020-08-07 17:36:22 +02:00
Jacob Heun
8cd9dfb137
feat(cli): add support for specifying type and size (#122) 2020-04-22 16:32:38 +02:00
Hugo Dias
c305c36b26
fix: add buffer (#120)
related to this https://github.com/ipfs/js-ipfs/issues/2924
2020-03-18 17:33:29 +01:00
Carson Farmer
a5070aea6e feat: adds typescript types + type tests (#110)
* feat: adds typescript types + type tests

Signed-off-by: Carson Farmer <carson.farmer@gmail.com>

* feat: updates to latest cids release

Signed-off-by: Carson Farmer <carson.farmer@gmail.com>
2020-01-27 12:07:52 +01:00
Jacob Heun
bbf0416f08 feat: deprecate isEqual in favor of equals (#107) 2019-11-12 15:00:11 +01:00
Marcin Rataj
544ca7d74b feat: support Peer ID represented as CID (#105)
* feat: support Peer ID represented as CID

This change adds two functions:

- createFromCID accepts CID as String|CID|Buffer
  and creates PeerId from the multihash value inside of it
- toCIDString serializes PeerId multihash into a CIDv1 in Base32,
  as agreed in https://github.com/libp2p/specs/pull/209

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* refactor: rename toCIDString to toString

CIDv1 is self describing, and toString was not defined.
Makes sense to use generic toString in this case.

This change also:
- remembers string with CID, so it is lazily generated only once
- switches createFromB58String to createFromCID (b58 is CIDv0),
  making it easier to migrate existing codebases.

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* docs: comment tests

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* feat: validate CID multicodec

- require CID with 'libp2p-key' (CIDv1) or 'dag-pb' (CIDv0 converted to CIDv1)
- delegate CID validation to CID constructor

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-11-04 18:22:29 +01:00
Topper Bowers
f39fb24321 feat: allow nested PeerIds to support pubKey function when using identity encoding (#101) 2019-09-25 15:39:24 +02:00
Maciej Krüger
76864184da feat: add compact protobuf format (#76)
* docs: document .createFromProtobuf and .marshal
* fix: lint
* test: verify .marshal() does it's job
2019-07-12 18:35:46 +01:00
Arve Knudsen
17440a3f9a feat(peerid): support creating from secp256k1; harmonize algo with Go (#95) 2019-07-11 20:31:39 +01:00
Henrique Dias
c3463c7421 feat: async await (#87)
BREAKING CHANGE: API refactored to use async/await
2019-07-11 18:09:21 +01:00
Michael Garvin
e8ab1b9281 feat: change toPrint output to match go implementation 2018-07-02 19:26:03 +02:00
Maciej Krüger
156911e162 fix: catch error when unmarshaling instead of crashing (#72) 2017-12-01 08:49:50 +00:00
ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ
f91f2b6506 chore: Updating CI files (#70)
* Updating CI files

This commit updates all CI scripts to the latest version

* Faster tests
2017-11-24 17:46:24 +00:00
Yahya
3abdcdabbb fix: Always add public key to constructor if possible, Fix for undefined pubKey in remote peers (#68)
* Always add public key to constructor if possible

* extending Non-default # of bits test time, travis took 59521ms

License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
2017-10-12 10:09:18 +02:00
Friedel Ziegelmayer
d7088d6650 feat(deps): update aegir and libp2p-crypto (#67) 2017-09-07 14:50:44 +01:00
David Dias
442df13a11 feat: use next libp2p-crypto (#64)
* feat: use next libp2p-crypto

* chore: update deps
2017-07-22 13:37:01 -07:00
David Dias
ac27907241 feat: set privKey pubKey 2017-04-02 22:47:44 -04:00