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 examples
``` | prefix | codec | desc | type | [packed encoding](https://github.com/multiformats/multicodec/blob/master/multicodec-packed.md)|
prefix - codec - desc |----------------|-------|-------------|-------|---------------------------------------|
---------------------------- |0x052f62696e2f | /bin/ |raw binary |binary | 0x00 |
// the bases |0x042f62322f | /b2/ |ascii base2 |binary | |
0x052f62696e2f - /bin/ - raw binary |0x052f6231362f | /b16/ |ascii base16 |hex | |
0x042f62322f - /b2/ - ascii base2 (binary) |0x052f6233322f | /b32/ |ascii base32 | | |
0x052f6231362f - /b16/ - ascii base16 (hex) |0x052f6235382f | /b58/ |ascii base58 | | |
0x052f6233322f - /b32/ - ascii base32 |0x052f6236342f | /b64/ |ascii base64 | | |
0x052f6235382f - /b58/ - ascii base58 |0x062f6a736f6e2f |/json/ | |json | |
0x052f6236342f - /b64/ - ascii base64 |0x062f63626f722f |/cbor/ | |json | |
|0x062f62736f6e2f |/bson/ | |json | |
// the JSONs |0x072f626a736f6e2f|/bjson/| |json | |
062f6a736f6e2f - /json/ |0x082f75626a736f6e2f| /ubjson/| |json | |
062f63626f722f - /cbor/ |0x182f6d756c7469636f6465632f | /multicodec/ | | multiformat | 0x40 |
062f62736f6e2f - /bson/ |0x162f6d756c7469686173682f | /multihash/ | | multiformat | 0x41 |
072f626a736f6e2f - /bjson/ |0x162f6d756c7469616464722f | /multiaddr/ | | multiformat | 0x42 |
082f75626a736f6e2f - /ubjson/ |0x0a2f70726f746f6275662f |/protobuf/ | Protocol Buffers |protobuf| |
|0x072f6361706e702f | /capnp/ | Cap-n-Proto |protobuf| |
// protobuf |0x092f666c61746275662f |/flatbuf/ | FlatBuffers |protobuf| |
0a2f70726f746f6275662f - /protobuf/ - Protocol Buffers |0x052f7461722f |/tar/ | | archive | |
072f6361706e702f - /capnp/ - Cap-n-Proto |0x052f7a69702f |/zip/ | | archive | |
092f666c61746275662f - /flatbuf/ - FlatBuffers |0x052f706e672f | /png/ | | archive | |
|0x052f726c702f | /rlp/ | recursive length prefix | ethereum | 0x60 |
// archives
0x052f7461722f /tar/
0x052f7a69702f /zip/
// images
0x052f706e672f - /png/
```
## The protocol path ## 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. `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.