8cd9dfb137
feat(cli): add support for specifying type and size ( #122 )
2020-04-22 16:32:38 +02:00
c305c36b26
fix: add buffer ( #120 )
...
related to this https://github.com/ipfs/js-ipfs/issues/2924
2020-03-18 17:33:29 +01:00
f775e3509b
chore: update index.d.ts ( #115 )
...
Tell Typescript that `isPeerId(id)` returns true if, and only if, `id` is of type `PeerId`.
See https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates
2020-02-19 11:51:59 -05:00
00819ba4eb
chore: update index.d.ts ( #116 )
...
This tells Typescript that `id` is immutable.
2020-02-19 09:17:30 -05:00
f44645ef7e
fix: remove use of assert module ( #117 )
...
The polyfill is big, we can simulate it by throwing an Error and it doesn't work under React Native.
2020-02-18 08:42:39 -05:00
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
65e0b746a5
fix: catch errors thrown by multihash decode ( #109 )
2019-12-18 10:17:59 +00:00
bbf0416f08
feat: deprecate isEqual in favor of equals ( #107 )
2019-11-12 15:00:11 +01:00
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
11d4ec10bd
fix: bang in bin.js ( #106 )
2019-11-04 12:26:50 +01:00
f39fb24321
feat: allow nested PeerIds to support pubKey function when using identity encoding ( #101 )
2019-09-25 15:39:24 +02:00
911aa634d3
chore: lead maintainer update ( #98 )
2019-07-30 21:17:24 +02:00
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
17440a3f9a
feat(peerid): support creating from secp256k1; harmonize algo with Go ( #95 )
2019-07-11 20:31:39 +01:00
c3463c7421
feat: async await ( #87 )
...
BREAKING CHANGE: API refactored to use async/await
2019-07-11 18:09:21 +01:00
cd2099305e
fix: clean repo and bundle size reduction
2019-01-09 15:03:49 +00:00
2e5e666140
fix: add peerIdWithIs to the API functions using the instance
2018-10-17 10:51:42 +01:00
6513a02e1e
feat: add class-is module
2018-10-04 11:29:31 +01:00
e8ab1b9281
feat: change toPrint output to match go implementation
2018-07-02 19:26:03 +02:00
156911e162
fix: catch error when unmarshaling instead of crashing ( #72 )
2017-12-01 08:49:50 +00:00
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
d7088d6650
feat(deps): update aegir and libp2p-crypto ( #67 )
2017-09-07 14:50:44 +01:00
442df13a11
feat: use next libp2p-crypto ( #64 )
...
* feat: use next libp2p-crypto
* chore: update deps
2017-07-22 13:37:01 -07:00
ac27907241
feat: set privKey pubKey
2017-04-02 22:47:44 -04:00
3f4f670691
feat: isEqual
2017-03-30 09:47:11 +01:00
a3fe1a2f03
fix: avoid using constructor.name
2017-03-27 13:58:21 +01:00
0acc572fd3
feat: isPeerId
2017-03-27 13:23:18 +01:00
78d96d0b14
feat: create b58 string on creation and throw on id mutation
2016-12-18 09:02:37 +01:00
bebb0a7eae
feat: cache b58 id
2016-12-14 09:05:07 +01:00
31701e236d
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
2016-11-03 07:51:29 +00:00
58f1933980
fix: code review and docs and go interop
2016-05-24 14:03:31 +02:00
4beb1f8888
refactor: use libp2p and standardized rsa keys
2016-05-23 22:06:25 +02:00
b358530dfb
add toJSON and fromJSOn and cli to quickly generate
2016-05-23 15:25:30 +01:00
4afbedb525
update dependencies
2016-05-23 14:16:30 +01:00
ab76788771
Use dignified.js
2016-03-22 17:01:46 +01:00
727355c4f5
exposes opts + bits
2016-03-14 17:10:02 -07:00
d4c3de1ecb
codestyle
2016-03-10 19:43:23 +00:00
ca9cef6de7
comparing buffers
2016-03-10 11:25:59 -08:00
f55eebcef7
buffer the public key for consistency
2016-03-10 10:32:48 -08:00
59b89039b6
came to fix a square bracket, ended up touch a bunch of other things :)
2016-03-03 17:31:33 +00:00
845bd088fe
add coverage, fix codestyle
2016-02-14 07:32:09 +00:00
effa21b892
removed node forge bundle comment
2016-02-13 13:46:33 -08:00
de572bd15f
Merge branch 'master' of https://github.com/nginnever/js-peer-id
2016-02-12 19:56:37 -08:00
1a336f9289
cleanup changes
2016-02-12 19:55:44 -08:00
d9b9ca8812
Delete crypto.proto
2016-02-12 19:45:50 -08:00
58fe038e07
time out increased
2016-02-12 16:13:09 -08:00
7ae9be8f71
new tests
2016-02-12 14:55:05 -08:00
16c77433f9
getting ready to rewrite tests
2016-02-10 13:55:59 -08:00
6ce01ab434
keys now generated and derived match with go client
2016-02-04 12:02:18 -08:00
5cb511c646
added create id from private key
2016-02-04 12:01:58 -08:00