Merge pull request #12 from wanderer/master

added table
This commit is contained in:
David Dias 2016-09-23 15:55:50 +08:00 committed by GitHub
commit 2ac8b4a9b2

View File

@ -76,37 +76,29 @@ See also: [multicodec-packed](./multicodec-packed.md).
## Prefix examples
```
prefix - codec - desc
----------------------------
// the bases
0x052f62696e2f - /bin/ - raw binary
0x042f62322f - /b2/ - ascii base2 (binary)
0x052f6231362f - /b16/ - ascii base16 (hex)
0x052f6233322f - /b32/ - ascii base32
0x052f6235382f - /b58/ - ascii base58
0x052f6236342f - /b64/ - ascii base64
// the JSONs
062f6a736f6e2f - /json/
062f63626f722f - /cbor/
062f62736f6e2f - /bson/
072f626a736f6e2f - /bjson/
082f75626a736f6e2f - /ubjson/
// protobuf
0a2f70726f746f6275662f - /protobuf/ - Protocol Buffers
072f6361706e702f - /capnp/ - Cap-n-Proto
092f666c61746275662f - /flatbuf/ - FlatBuffers
// archives
0x052f7461722f /tar/
0x052f7a69702f /zip/
// images
0x052f706e672f - /png/
```
| prefix | codec | desc | type | [packed encoding](https://github.com/multiformats/multicodec/blob/master/multicodec-packed.md)|
|----------------|-------|-------------|-------|---------------------------------------|
|0x052f62696e2f | /bin/ |raw binary |binary | 0x00 |
|0x042f62322f | /b2/ |ascii base2 |binary | |
|0x052f6231362f | /b16/ |ascii base16 |hex | |
|0x052f6233322f | /b32/ |ascii base32 | | |
|0x052f6235382f | /b58/ |ascii base58 | | |
|0x052f6236342f | /b64/ |ascii base64 | | |
|0x062f6a736f6e2f |/json/ | |json | |
|0x062f63626f722f |/cbor/ | |json | |
|0x062f62736f6e2f |/bson/ | |json | |
|0x072f626a736f6e2f|/bjson/| |json | |
|0x082f75626a736f6e2f| /ubjson/| |json | |
|0x182f6d756c7469636f6465632f | /multicodec/ | | multiformat | 0x40 |
|0x162f6d756c7469686173682f | /multihash/ | | multiformat | 0x41 |
|0x162f6d756c7469616464722f | /multiaddr/ | | multiformat | 0x42 |
|0x0a2f70726f746f6275662f |/protobuf/ | Protocol Buffers |protobuf| |
|0x072f6361706e702f | /capnp/ | Cap-n-Proto |protobuf| |
|0x092f666c61746275662f |/flatbuf/ | FlatBuffers |protobuf| |
|0x052f7461722f |/tar/ | | archive | |
|0x052f7a69702f |/zip/ | | archive | |
|0x052f706e672f | /png/ | | archive | |
|0x052f726c702f | /rlp/ | recursive length prefix | ethereum | 0x60 |
## The protocol path
`multicodec` allows us to specify different protocols in a universal namespace, that way being able to recognize, multiplex, and embed them easily. We use the notion of a `path` instead of an `id` because it is meant to be a Unix-friendly URI.