break multicodec table into its own file, add a note of how to add new codes

This commit is contained in:
David Dias 2016-11-13 05:23:37 +00:00
parent 6d7f49dbc4
commit 0c9d2dfbea
2 changed files with 95 additions and 86 deletions

View File

@ -52,96 +52,17 @@ Multicodec uses "protocol tables" to agree upon the mapping from one multicodec
## Multicodec table
```csv
codec, description, code
The full table can be found at [table.csv](/table.csv) inside this repo.
miscelaneous
bin, raw binary, 0x55
### Adding new multicodecs to the table
bases encodings
base1, unary, 0x01
base2, binary (0 and 1), 0x55
base8, octal, 0x07
base10, decimal, 0x09
base16, hexadecimal, 0x
base32, rfc4648, 0x
base32hex, rfc4648, 0x
base58flickr, base58 flicker, 0x
base58btc, base58 bitcoin, 0x
base64, rfc4648, 0x
base64url, rfc4648, 0x
The process to add a new multicodec to the table is the following:
serialization formats
cbor, CBOR, 0x
bson, Binary JSON, 0x
ubjson, Universal Binary JSON, 0x
protobuf, Protocol Buffers, 0x
capnp, Cap-n-Proto, 0x
flatbuf, FlatBuffers, 0x
rlp, recursive length prefix, 0x60
- 1. Fork this repo
- 2. Update the table with the value you want to add
- 3. Submit a Pull Request
multiformats
multicodec, , 0x30
multihash, , 0x31
multiaddr, , 0x32
multibase, , 0x33
multihashes
sha1, , 0x11
sha2-256, , 0x12
sha2-512, , 0x13
sha3-224, , 0x17
sha3-256, , 0x16
sha3-384, , 0x15
sha3-512, , 0x14
shake-128, , 0x18
shake-256, , 0x19
keccak-224, , 0x1A
keccak-256, , 0x1B
keccak-384, , 0x1C
keccak-512, , 0x1D
Note: keccak has variable output length, instead the number specifies the core length,,
blake2b, , 0x40
blake2s, , 0x41
reserved for apps, appl specific range, 0x4000-0x40f0
multiaddrs
ip4, , 0x04
ip6, , 0x29
tcp, , 0x06
udp, , 0x0111
dccp, , 0x21
sctp, , 0x84
udt, , 0x012D
utp, , 0x012E
ipfs, , 0x2A
http, , 0x01E0
https, , 0x01BB
ws, , 0x01DD
onion, , 0x01BC
archiving formats
tar, , 0x
zip, , 0x
image formats
png, , 0x
jpg, , 0x
video formats
mp4, , 0x
mkv, , 0x
IPLD formats
dag-pb, MerkleDAG protobuf, 0x70
dag-cbor, MerkleDAG cbor, 0x71
eth-block, Ethereum Block (RLP), 0x90
eth-tx, Ethereum Tx (RLP), 0x91
bitcoin-block, Bitcoin Block, 0xb0
bitcoin-tx, Bitcoin Tx, 0xb1
stellar-block, Stellar Block, 0xd0
stellar-tx, Stellar Tx, 0xd1
```
This ["first come, first assign"](https://github.com/multiformats/multicodec/pull/16#issuecomment-260146609) policy is a way to assign codes as they are most needed, without increasing the size of the table (and therefore the size of the multicodecs) too rapidly.
## Implementations

88
table.csv Normal file
View File

@ -0,0 +1,88 @@
codec, description, code
miscelaneous,,
bin, raw binary, 0x55
bases encodings,,
base1, unary, 0x01
base2, binary (0 and 1), 0x55
base8, octal, 0x07
base10, decimal, 0x09
base16, hexadecimal, 0x
base32, rfc4648, 0x
base32hex, rfc4648, 0x
base58flickr, base58 flicker, 0x
base58btc, base58 bitcoin, 0x
base64, rfc4648, 0x
base64url, rfc4648, 0x
serialization formats,,
cbor, CBOR, 0x
bson, Binary JSON, 0x
ubjson, Universal Binary JSON, 0x
protobuf, Protocol Buffers, 0x
capnp, Cap-n-Proto, 0x
flatbuf, FlatBuffers, 0x
rlp, recursive length prefix, 0x60
multiformats,,
multicodec, , 0x30
multihash, , 0x31
multiaddr, , 0x32
multibase, , 0x33
multihashes,,
sha1, , 0x11
sha2-256, , 0x12
sha2-512, , 0x13
sha3-224, , 0x17
sha3-256, , 0x16
sha3-384, , 0x15
sha3-512, , 0x14
shake-128, , 0x18
shake-256, , 0x19
keccak-224, , 0x1A
keccak-256, , 0x1B
keccak-384, , 0x1C
keccak-512, , 0x1D
,, Note: keccak has variable output length. The number specifies the core length
blake2b, , 0x40
blake2s, , 0x41
reserved for apps, appl specific range, 0x4000-0x40f0
multiaddrs,,
ip4, , 0x04
ip6, , 0x29
tcp, , 0x06
udp, , 0x0111
dccp, , 0x21
sctp, , 0x84
udt, , 0x012D
utp, , 0x012E
ipfs, , 0x2A
http, , 0x01E0
https, , 0x01BB
ws, , 0x01DD
onion, , 0x01BC
archiving formats,,
tar, , 0x
zip, , 0x
image formats,,
png, , 0x
jpg, , 0x
video formats,,
mp4, , 0x
mkv, , 0x
IPLD formats,,
dag-pb, MerkleDAG protobuf, 0x70
dag-cbor, MerkleDAG cbor, 0x71
eth-block, Ethereum Block (RLP), 0x90
eth-tx, Ethereum Tx (RLP), 0x91
bitcoin-block, Bitcoin Block, 0xb0
bitcoin-tx, Bitcoin Tx, 0xb1
stellar-block, Stellar Block, 0xd0
stellar-tx, Stellar Tx, 0xd1
1 codec description code
2 miscelaneous
3 bin raw binary 0x55
4 bases encodings
5 base1 unary 0x01
6 base2 binary (0 and 1) 0x55
7 base8 octal 0x07
8 base10 decimal 0x09
9 base16 hexadecimal 0x
10 base32 rfc4648 0x
11 base32hex rfc4648 0x
12 base58flickr base58 flicker 0x
13 base58btc base58 bitcoin 0x
14 base64 rfc4648 0x
15 base64url rfc4648 0x
16 serialization formats
17 cbor CBOR 0x
18 bson Binary JSON 0x
19 ubjson Universal Binary JSON 0x
20 protobuf Protocol Buffers 0x
21 capnp Cap-n-Proto 0x
22 flatbuf FlatBuffers 0x
23 rlp recursive length prefix 0x60
24 multiformats
25 multicodec 0x30
26 multihash 0x31
27 multiaddr 0x32
28 multibase 0x33
29 multihashes
30 sha1 0x11
31 sha2-256 0x12
32 sha2-512 0x13
33 sha3-224 0x17
34 sha3-256 0x16
35 sha3-384 0x15
36 sha3-512 0x14
37 shake-128 0x18
38 shake-256 0x19
39 keccak-224 0x1A
40 keccak-256 0x1B
41 keccak-384 0x1C
42 keccak-512 0x1D
43 Note: keccak has variable output length. The number specifies the core length
44 blake2b 0x40
45 blake2s 0x41
46 reserved for apps appl specific range 0x4000-0x40f0
47 multiaddrs
48 ip4 0x04
49 ip6 0x29
50 tcp 0x06
51 udp 0x0111
52 dccp 0x21
53 sctp 0x84
54 udt 0x012D
55 utp 0x012E
56 ipfs 0x2A
57 http 0x01E0
58 https 0x01BB
59 ws 0x01DD
60 onion 0x01BC
61 archiving formats
62 tar 0x
63 zip 0x
64 image formats
65 png 0x
66 jpg 0x
67 video formats
68 mp4 0x
69 mkv 0x
70 IPLD formats
71 dag-pb MerkleDAG protobuf 0x70
72 dag-cbor MerkleDAG cbor 0x71
73 eth-block Ethereum Block (RLP) 0x90
74 eth-tx Ethereum Tx (RLP) 0x91
75 bitcoin-block Bitcoin Block 0xb0
76 bitcoin-tx Bitcoin Tx 0xb1
77 stellar-block Stellar Block 0xd0
78 stellar-tx Stellar Tx 0xd1