Skip to content

Commit ad444ff

Browse files
committed
add multihash, multiaddrs and multibase tables
1 parent 39712a2 commit ad444ff

1 file changed

Lines changed: 76 additions & 48 deletions

File tree

README.md

Lines changed: 76 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Moreover, this self-description allows straightforward layering of protocols wit
3838
`multicodec` is a _self-describing multiformat_, it wraps other formats with a tiny bit of self-description:
3939

4040
```sh
41-
<varint-len><multicodec><encoded-data>
41+
<varint-len><multicodec>\n<encoded-data>
4242
```
4343

4444
For example, let's encode a json doc:
@@ -98,53 +98,80 @@ These path names happen to be resolvable -- not just in a "multicodec muxer(e.g
9898

9999
## Multicodec table
100100

101-
| prefix | codec | description | [packed](https://github.com/multiformats/multicodec/blob/master/multicodec-packed.md)|
102-
|-------------------------------|---------------|-------------------------|-----------|
103-
| **Miscelaneous** |
104-
| 0x052f62696e2f | /bin/ | raw binary | 0x00 |
105-
| **Bases encodings** |
106-
| 0x042f62322f | /b2/ | ascii base2 | |
107-
| 0x052f6231362f | /b16/ | ascii base16 | |
108-
| 0x052f6233322f | /b32/ | ascii base32 | |
109-
| 0x052f6235382f | /b58/ | ascii base58 | |
110-
| 0x052f6236342f | /b64/ | ascii base64 | |
111-
| **Serialization formats** |
112-
| 0x062f6a736f6e2f | /json/ | | |
113-
| 0x062f63626f722f | /cbor/ | | |
114-
| 0x062f62736f6e2f | /bson/ | | |
115-
| 0x072f626a736f6e2f | /bjson/ | | |
116-
| 0x082f75626a736f6e2f | /ubjson/ | | |
117-
| 0x0a2f70726f746f6275662f | /protobuf/ | Protocol Buffers | |
118-
| 0x072f6361706e702f | /capnp/ | Cap-n-Proto | |
119-
| 0x092f666c61746275662f | /flatbuf/ | FlatBuffers | |
120-
| 0x052f726c702f | /rlp/ | recursive length prefix | 0x60 |
121-
| **Multiformats** |
122-
| 0x182f6d756c7469636f6465632f | /multicodec/ | | 0x40 |
123-
| 0x162f6d756c7469686173682f | /multihash/ | | 0x41 |
124-
| 0x162f6d756c7469616464722f | /multiaddr/ | | 0x42 |
125-
| **Multihashes** |
126-
| | | | |
127-
| **Multiaddrs** |
128-
| | | | |
129-
| **Archiving formats** |
130-
| 0x052f7461722f | /tar/ | | |
131-
| 0x052f7a69702f | /zip/ | | |
132-
| **Image formats** |
133-
| 0x052f706e672f | /png/ | | |
134-
| | /jpg/ | | |
135-
| **Video formats** |
136-
| | /mp4/ | | |
137-
| | /mkv/ | | |
138-
| **Blockchain formats** |
139-
| n/a | n/a | n/a | n/a |
140-
| **VCS formats** |
141-
| n/a | n/a | n/a | n/a |
142-
| **IPLD formats** |
143-
| | /dag-pb/ | MerkleDAG protobuf | |
144-
| | /dag-cbor/ | MerkleDAG cbor | |
145-
| | /eth-rlp/ | Ethereum Block RLP | |
146-
147-
101+
| prefix | codec | description | [packed][p] | multibase only |
102+
|-------------------------------|-----------------|-------------------------|-------------|----------------|
103+
| **Miscelaneous** |
104+
| 0x052f62696e2f | /bin/ | raw binary | 0x00 | n/a |
105+
| **Bases encodings** |
106+
| | /base1/ | unary | | 1 |
107+
| | /base2/ | binary (0 and 1) | | 0 |
108+
| | /base8/ | octal | | 7 |
109+
| | /base10/ | decimal | | 9 |
110+
| | /base16/ | hexadecimal | | F, f |
111+
| | /base32/ | rfc4648 | | U, u |
112+
| | /base32hex/ | rfc4648 | | V, v |
113+
| | /base58flickr/ | base58 flicker | | Z |
114+
| | /base58btc/ | base58 bitcoin | | z |
115+
| | /base64/ | rfc4648 | | y |
116+
| | /base64url/ | rfc4648 | | Y |
117+
| **Serialization formats** |
118+
| 0x062f6a736f6e2f | /json/ | | | n/a |
119+
| 0x062f63626f722f | /cbor/ | | | n/a |
120+
| 0x062f62736f6e2f | /bson/ | | | n/a |
121+
| 0x072f626a736f6e2f | /bjson/ | | | n/a |
122+
| 0x082f75626a736f6e2f | /ubjson/ | | | n/a |
123+
| 0x0a2f70726f746f6275662f | /protobuf/ | Protocol Buffers | | n/a |
124+
| 0x072f6361706e702f | /capnp/ | Cap-n-Proto | | n/a |
125+
| 0x092f666c61746275662f | /flatbuf/ | FlatBuffers | | n/a |
126+
| 0x052f726c702f | /rlp/ | recursive length prefix | 0x60 | n/a |
127+
| **Multiformats** |
128+
| 0x182f6d756c7469636f6465632f | /multicodec/ | | 0x30 | n/a |
129+
| 0x162f6d756c7469686173682f | /multihash/ | | 0x31 | n/a |
130+
| 0x162f6d756c7469616464722f | /multiaddr/ | | 0x32 | n/a |
131+
| **Multihashes** |
132+
| | /sha1/ | | 0x11 | n/a |
133+
| | /sha2-256/ | | 0x12 | n/a |
134+
| | /sha2-512/ | | 0x13 | n/a |
135+
| | /sha3-256/ | | 0x16 | n/a |
136+
| | /sha3-384/ | | 0x15 | n/a |
137+
| | /sha3-512/ | | 0x14 | n/a |
138+
| | /shake-128/ | | 0x18 | n/a |
139+
| | /shake-256/ | | 0x19 | n/a |
140+
| | /blake2b/ | | 0x40 | n/a |
141+
| | /blake2s/ | | 0x41 | n/a |
142+
| **Multiaddrs** |
143+
| | /ip4/ | | 0x04 | n/a |
144+
| | /ip6/ | | 0x29 | n/a |
145+
| | /tcp/ | | 0x06 | n/a |
146+
| | /udp/ | | 0x11 | n/a |
147+
| | /dccp/ | | 0x21 | n/a |
148+
| | /sctp/ | | 0x84 | n/a |
149+
| | /udt/ | | 0x012D | n/a |
150+
| | /utp/ | | 0x012E | n/a |
151+
| | /ipfs/ | | 0x2A | n/a |
152+
| | /http/ | | 0x01E0 | n/a |
153+
| | /https/ | | 0x01BB | n/a |
154+
| | /ws/ | | 0x01DD | n/a |
155+
| | /onion/ | | 0x01BC | n/a |
156+
| **Archiving formats** |
157+
| 0x052f7461722f | /tar/ | | | n/a |
158+
| 0x052f7a69702f | /zip/ | | | n/a |
159+
| **Image formats** |
160+
| 0x052f706e672f | /png/ | | | n/a |
161+
| | /jpg/ | | | n/a |
162+
| **Video formats** |
163+
| | /mp4/ | | | n/a |
164+
| | /mkv/ | | | n/a |
165+
| **Blockchain formats** |
166+
| | | | | n/a |
167+
| **VCS formats** |
168+
| | | | | n/a |
169+
| **IPLD formats** |
170+
| | /dag-pb/ | MerkleDAG protobuf | | n/a |
171+
| | /dag-cbor/ | MerkleDAG cbor | | n/a |
172+
| | /eth-rlp/ | Ethereum Block RLP | | n/a |
173+
174+
Note: Base encodings present a multibase encoding special char, so that the codec doesn't break the encoded version of the data it is describing.
148175

149176
## Implementations
150177

@@ -196,3 +223,4 @@ Check out our [contributing document](https://github.com/multiformats/multiforma
196223

197224
[MIT](LICENSE)
198225

226+
[p](https://github.com/multiformats/multicodec/blob/master/multicodec-packed.md)

0 commit comments

Comments
 (0)