|
1 | | -# multiformats |
2 | | - |
3 | | -* [Interfaces](#interfaces) |
4 | | - * [Creating Blocks](#creating-blocks) |
5 | | - * [Multibase Encoders / Decoders / Codecs](#multibase-encoders--decoders--codecs) |
6 | | - * [Multicodec Encoders / Decoders / Codecs](#multicodec-encoders--decoders--codecs) |
7 | | - * [Multihash Hashers](#multihash-hashers) |
8 | | - * [Traversal](#traversal) |
9 | | -* [Legacy interface](#legacy-interface) |
10 | | -* [Implementations](#implementations) |
11 | | - * [Multibase codecs](#multibase-codecs) |
12 | | - * [Multihash hashers](#multihash-hashers-1) |
13 | | - * [IPLD codecs (multicodec)](#ipld-codecs-multicodec) |
14 | | -* [License](#license) |
15 | | - * [Contribution](#contribution) |
| 1 | +# multiformats <!-- omit in toc --> |
| 2 | + |
| 3 | +[](http://multiformats.io) |
| 4 | +[](https://codecov.io/gh/multiformats/js-multiformats) |
| 5 | +[](https://github.com/multiformats/js-multiformats/actions/workflows/js-test-and-release.yml) |
| 6 | + |
| 7 | +> Interface for multihash, multicodec, multibase and CID |
| 8 | +
|
| 9 | +## Table of contents <!-- omit in toc --> |
| 10 | + |
| 11 | +- [Install](#install) |
| 12 | +- [Interfaces](#interfaces) |
| 13 | + - [Creating Blocks](#creating-blocks) |
| 14 | + - [Multibase Encoders / Decoders / Codecs](#multibase-encoders--decoders--codecs) |
| 15 | + - [Multicodec Encoders / Decoders / Codecs](#multicodec-encoders--decoders--codecs) |
| 16 | + - [Multihash Hashers](#multihash-hashers) |
| 17 | + - [Traversal](#traversal) |
| 18 | +- [Legacy interface](#legacy-interface) |
| 19 | +- [Implementations](#implementations) |
| 20 | + - [Multibase codecs](#multibase-codecs) |
| 21 | + - [Multihash hashers](#multihash-hashers-1) |
| 22 | + - [IPLD codecs (multicodec)](#ipld-codecs-multicodec) |
| 23 | +- [License](#license) |
| 24 | +- [Contribution](#contribution) |
| 25 | + |
| 26 | +## Install |
| 27 | + |
| 28 | +```console |
| 29 | +$ npm i multiformats |
| 30 | +``` |
| 31 | + |
| 32 | +- [Interfaces](#interfaces) |
| 33 | + - [Creating Blocks](#creating-blocks) |
| 34 | + - [Multibase Encoders / Decoders / Codecs](#multibase-encoders--decoders--codecs) |
| 35 | + - [Multicodec Encoders / Decoders / Codecs](#multicodec-encoders--decoders--codecs) |
| 36 | + - [Multihash Hashers](#multihash-hashers) |
| 37 | + - [Traversal](#traversal) |
| 38 | +- [Legacy interface](#legacy-interface) |
| 39 | +- [Implementations](#implementations) |
| 40 | + - [Multibase codecs](#multibase-codecs) |
| 41 | + - [Multihash hashers](#multihash-hashers-1) |
| 42 | + - [IPLD codecs (multicodec)](#ipld-codecs-multicodec) |
| 43 | +- [License](#license) |
| 44 | + - [Contribution](#contribution) |
16 | 45 |
|
17 | 46 | This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. |
18 | 47 |
|
@@ -77,7 +106,6 @@ them as `encoder` and `decoder` properties. For added convenience codecs also |
77 | 106 | implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be |
78 | 107 | used as either or both: |
79 | 108 |
|
80 | | - |
81 | 109 | ```js |
82 | 110 | cid.toString(base64) |
83 | 111 | CID.parse(cid.toString(base64), base64) |
@@ -189,43 +217,43 @@ import the ones you need yourself. |
189 | 217 |
|
190 | 218 | ### Multibase codecs |
191 | 219 |
|
192 | | -| bases | import | repo | |
193 | | - --- | --- | --- | |
194 | | -`base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
195 | | -`base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
196 | | -`base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
197 | | -`base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
| 220 | +| bases | import | repo | |
| 221 | +| ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | |
| 222 | +| `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
| 223 | +| `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
| 224 | +| `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
| 225 | +| `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | |
198 | 226 |
|
199 | 227 | Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. |
200 | 228 |
|
201 | 229 | ### Multihash hashers |
202 | 230 |
|
203 | | -| hashes | import | repo | |
204 | | -| --- | --- | --- | |
205 | | -| `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | |
206 | | -| `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | |
207 | | -| `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | |
208 | | -| `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | |
209 | | -| `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | |
| 231 | +| hashes | import | repo | |
| 232 | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | |
| 233 | +| `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | |
| 234 | +| `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | |
| 235 | +| `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | |
| 236 | +| `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | |
| 237 | +| `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | |
210 | 238 |
|
211 | 239 | ### IPLD codecs (multicodec) |
212 | 240 |
|
213 | | -| codec | import | repo | |
214 | | -| --- | --- | --- | |
215 | | -| `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | |
216 | | -| `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | |
217 | | -| `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | |
218 | | -| `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | |
219 | | -| `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | |
220 | | -| `dag-jose` | `dag-jose`| [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | |
| 241 | +| codec | import | repo | |
| 242 | +| ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | |
| 243 | +| `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | |
| 244 | +| `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | |
| 245 | +| `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | |
| 246 | +| `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | |
| 247 | +| `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | |
| 248 | +| `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | |
221 | 249 |
|
222 | 250 | ## License |
223 | 251 |
|
224 | 252 | Licensed under either of |
225 | 253 |
|
226 | | - * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0) |
227 | | - * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT) |
| 254 | +- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) |
| 255 | +- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) |
228 | 256 |
|
229 | | -### Contribution |
| 257 | +## Contribution |
230 | 258 |
|
231 | 259 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
0 commit comments