File tree Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const varint = require ( 'varint' )
4
4
5
+ // spec and table at: https://github.com/multiformats/multicodec
6
+
7
+ // TODO revisit all of these once https://github.com/multiformats/multicodec/pull/16 is merged
8
+
5
9
exports = module . exports
6
10
7
11
// Miscellaneous
8
12
exports . raw = varintBuf ( 0 ) // 0x00
9
13
10
- // Multiformats
11
- exports . multicodec = varintBuf ( 64 ) // 0x40
12
- exports . multihash = varintBuf ( 65 ) // 0x41
13
- exports . multiaddr = varintBuf ( 66 ) // 0x42
14
+ // bases encodings
14
15
15
16
// Serialization formats
16
17
exports . protobuf = varintBuf ( 80 ) // 0x50
17
18
exports . cbor = varintBuf ( 81 ) // 0x51
18
19
exports . rlp = varintBuf ( 96 ) // 0x60
19
20
21
+ // Multiformats
22
+ exports . multicodec = varintBuf ( 64 ) // 0x40
23
+ exports . multihash = varintBuf ( 65 ) // 0x41
24
+ exports . multiaddr = varintBuf ( 66 ) // 0x42
25
+
26
+ // multihashes
27
+
28
+ // multiaddrs
29
+
30
+ // archiving formats
31
+
32
+ // image formats
33
+
34
+ // video formats
35
+
36
+ // VCS formats
37
+
38
+ // IPLD formats
39
+ exports [ 'dag-pb' ] = new Buffer ( '70' , 'hex' )
40
+ exports [ 'dag-cbor' ] = new Buffer ( '71' , 'hex' )
41
+ exports [ 'eth-block' ] = new Buffer ( '90' , 'hex' )
42
+ exports [ 'eth-tx' ] = new Buffer ( '91' , 'hex' )
43
+
20
44
function varintBuf ( n ) {
21
45
return new Buffer ( varint . encode ( n ) )
22
46
}
You can’t perform that action at this time.
0 commit comments