multicodecs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0cbc0820c14127379a2a107103b88cfa5201c3f22d3942adcf35f5f0a1cb22ae
4
+ data.tar.gz: 59245217741f176d4b6c07095efa14bf1abf02dae2ef1b0accbe230611512b1a
5
+ SHA512:
6
+ metadata.gz: c2bbbd3a0b3c79d2a1e5281142b3366b55156da6fb300869253366e1a35d37914462dacb74c66da6847c993dfa6816aeb86d8d54040d337f43aa1e1d22f68c31
7
+ data.tar.gz: c9c3fc2b00c4cc40a23d1151454fe15235b8bedd0aaccecc3dc002071b3ce79fdba37b2331e9cfd92aedfa86a31f014b144ef5fe518543eddc2eeac3bb0e7a9e
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ Gemfile.lock
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.1
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in multicodecs.gemspec
4
+ gemspec
@@ -0,0 +1,137 @@
1
+ # Multicodecs
2
+
3
+ [![Build Status](https://travis-ci.com/SleeplessByte/ruby-multicodec.svg?token=FpDLv4Yva15pzqYpq9Hk&branch=master)][shield-link-travis]
4
+ [![Gem Version](https://badge.fury.io/rb/multicodecs.svg)][shield-link-gem]
5
+ [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)][shield-link-license]
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/-/maintainability)][shield-link-codeclimate]
7
+
8
+ [shield-link-travis]: https://travis-ci.com/SleeplessByte/ruby-multicodec
9
+ [shield-link-gem]: https://badge.fury.io/rb/multicodecs
10
+ [shield-link-license]: http://opensource.org/licenses/MIT
11
+ [shield-link-codeclimate]: https://codeclimate.com/repos/-/maintainability
12
+
13
+ > Canonical table of of codecs used by various multiformats
14
+
15
+ `Multicodecs` is the ruby implementation of [multiformats/multicodec][spec].
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ ```Ruby
22
+ gem 'multicodecs', require: false
23
+ ```
24
+
25
+ Or if you want to autoload the last known table:
26
+
27
+ ```Ruby
28
+ gem 'multicodecs'
29
+ ```
30
+
31
+ Or if you want the PORO _without_ any values:
32
+
33
+ ```Ruby
34
+ gem 'multicodecs', require: 'multicodecs/bare'
35
+ ```
36
+
37
+ And then execute:
38
+
39
+ $ bundle
40
+
41
+ Or install it yourself as:
42
+
43
+ $ gem install multicodecs
44
+
45
+ ## Usage
46
+
47
+ This is just a codec, not a protocol. This means that this gem only provides
48
+ a nice-to-use mapping from the [single source of truth][table] to a PORO. It
49
+ also allows you to bring your own values.
50
+
51
+ ```ruby
52
+ require 'multicodecs'
53
+
54
+ Multicodecs['identity']
55
+ # => #<struct Multicodecs::Registration code=0, name="identity", tag="multihash">
56
+
57
+ Multicodecs[0x12]
58
+ # => #<struct Multicodecs::Registration code=18, name="sha2-256", tag="multihash">
59
+
60
+ Multicodecs.find_by(name: 'protobuf')
61
+ # => #<struct Multicodecs::Registration code=80, name="protobuf", tag="serialization">
62
+ ```
63
+
64
+ You can `register` your own values
65
+
66
+ ```ruby
67
+ Multicodecs.register(code: 0x12345, name: 'xxx', tag: 'vendor')
68
+ # => #<struct Multicodecs::Registration code=74565, name="xxx", tag="vendor">
69
+ ```
70
+
71
+ Convenience methods exist:
72
+
73
+ - `Multicodecs.names`: returns all the known names
74
+ - `Multicodecs.codes`: returns all the known codes
75
+ - `Multicodecs.find_by(code: nil, name: nil)`: same as `[]`
76
+ - `Multicodecs.fetch_by!(code: nil, name: nil)`: same as `[]` but errors if not found
77
+ - `Multicodecs.load_csv(csv, radix: 16)`: loads table.csv like data
78
+
79
+ ## Related
80
+
81
+ - [`multiformats/multicodec`][git-multicodec]: the spec repository
82
+ - [`multiformats/ruby-multibase`][git-ruby-multibase]: the ruby implementation of [`multiformats/multibase`][git-multibase]
83
+ - [`multiformats/ruby-multihash`][git-ruby-multihash]: the ruby implementation of [`multiformats/multihash`][git-multihash]
84
+
85
+ ## Development
86
+
87
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
88
+ `rake test` to run the tests. You can also run `bin/console` for an interactive
89
+ prompt that will allow you to experiment.
90
+
91
+ To install this gem onto your local machine, run `bundle exec rake install`.
92
+ To release a new version, update the version number in `version.rb`, and then
93
+ run `bundle exec rake release`, which will create a git tag for the version,
94
+ push git commits and tags, and push the `.gem` file to [rubygems.org][web-rubygems].
95
+
96
+ ### Updating the table
97
+
98
+ The `Rakefile` provides an easy way of updating the `table.csv`, using a `rake`
99
+ command.
100
+
101
+ ```ruby
102
+ rake update
103
+ # => updated lib/table.csv
104
+ ```
105
+
106
+ ## Contributing
107
+
108
+ Bug reports and pull requests are welcome on GitHub at [SleeplessByte/ruby-multicodec][git-self].
109
+ This project is intended to be a safe, welcoming space for collaboration, and
110
+ contributors are expected to adhere to the [Contributor Covenant][web-coc] code
111
+ of conduct.
112
+
113
+ ## License
114
+
115
+ The gem is available as open source under the terms of the [MIT License][web-mit].
116
+
117
+ ## Code of Conduct
118
+
119
+ Everyone interacting in the Shrine::ConfigurableStorage project’s codebases,
120
+ issue trackers, chat rooms and mailing lists is expected to follow the
121
+ [code of conduct][git-self-coc].
122
+
123
+ [spec]: https://github.com/multiformats/multicodec
124
+ [git-self-coc]: https://github.com/SleeplessByte/ruby-multibase/blob/master/CODE_OF_CONDUCT.md
125
+ [git-self]: https://github.com/SleeplessByte/ruby-multibase
126
+ [git-ruby-multicodec]: https://github.com/SleeplessByte/ruby-multicodec
127
+ [git-multicodec-table]: https://github.com/multiformats/multicodec/blob/master/multicodec.csv
128
+ [git-multicodec]: https://github.com/multiformats/multicodec
129
+ [git-ruby-multibase]: https://github.com/SleeplessByte/ruby-multibase
130
+ [git-multibase]: https://github.com/multiformats/multibase
131
+ [git-ruby-multihash]: https://github.com/multiformats/ruby-multihash
132
+ [git-multihash]: https://github.com/multiformats/multihash
133
+ [web-coc]: http://contributor-covenant.org
134
+ [web-mit]: https://opensource.org/licenses/MIT
135
+ [web-rubygems]: https://rubygems.org
136
+
137
+
@@ -0,0 +1,22 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ Rake::Task.define_task(:update) do |t|
11
+ require 'open-uri'
12
+
13
+ SOURCE_FILE = 'https://raw.githubusercontent.com/multiformats/multicodec/master/table.csv'
14
+
15
+ File.open(File.join(__dir__, 'lib', 'table.csv'), "wb") do |saved_file|
16
+ open(SOURCE_FILE, "rb") do |read_file|
17
+ saved_file.write(read_file.read)
18
+ end
19
+ end
20
+ end
21
+
22
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "multicodecs"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'multicodecs/version'
4
+ require 'multicodecs/bare'
5
+ require 'csv'
6
+
7
+ module Multicodecs
8
+ load_csv CSV.open(File.join(__dir__, 'table.csv'), headers: true)
9
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './registry'
4
+
5
+ module Multicodecs
6
+
7
+ module_function
8
+
9
+ def load_csv(csv, radix: 16)
10
+ csv.each do |row|
11
+ name = row['name'] || row[0]
12
+ tag = row['tag'] || row[1]
13
+ code = row['code'] || row[2]
14
+
15
+ Multicodecs.register(name: name.strip, tag: tag.strip, code: code.strip.to_i(16))
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Multicodecs
4
+ # rubocop:disable Style/MutableConstant
5
+ REGISTRATIONS = {}
6
+ # rubocop:enable Style/MutableConstant
7
+
8
+ Registration = Struct.new(:code, :name, :tag) do
9
+ def hash
10
+ name.hash
11
+ end
12
+
13
+ def ==(other)
14
+ return name == other if other.is_a?(String)
15
+ return code == other if other.is_a?(Integer)
16
+
17
+ eql?(other)
18
+ end
19
+
20
+ def eql?(other)
21
+ other.is_a?(Registration) && other.name == name
22
+ end
23
+ end
24
+
25
+ module_function
26
+
27
+ def [](entry)
28
+ find_by(code: entry, name: entry)
29
+ end
30
+
31
+ def register(code:, name:, tag:)
32
+ Multicodecs::REGISTRATIONS[name] = Registration.new(
33
+ code,
34
+ name,
35
+ tag
36
+ )
37
+ end
38
+
39
+ def fetch_by!(code: nil, name: nil)
40
+ return Multicodecs::REGISTRATIONS.fetch(name) if name
41
+
42
+ Multicodecs.find_by(code: code).tap do |found|
43
+ raise KeyError, "No codec has code #{code}" unless found
44
+ end
45
+ end
46
+
47
+ def find_by(code: nil, name: nil)
48
+ Multicodecs::REGISTRATIONS.values.find do |v|
49
+ v == code || v == name
50
+ end
51
+ end
52
+
53
+ def codes
54
+ Multicodecs::REGISTRATIONS.values.map(&:code)
55
+ end
56
+
57
+ def names
58
+ Multicodecs::REGISTRATIONS.keys
59
+ end
60
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Multicodecs
4
+ VERSION = '0.1.0'
5
+ end
@@ -0,0 +1,423 @@
1
+ name, tag, code, description
2
+ identity, multihash, 0x00, raw binary
3
+ ip4, multiaddr, 0x04,
4
+ tcp, multiaddr, 0x06,
5
+ sha1, multihash, 0x11,
6
+ sha2-256, multihash, 0x12,
7
+ sha2-512, multihash, 0x13,
8
+ sha3-512, multihash, 0x14,
9
+ sha3-384, multihash, 0x15,
10
+ sha3-256, multihash, 0x16,
11
+ sha3-224, multihash, 0x17,
12
+ shake-128, multihash, 0x18,
13
+ shake-256, multihash, 0x19,
14
+ keccak-224, multihash, 0x1a, keccak has variable output length. The number specifies the core length
15
+ keccak-256, multihash, 0x1b,
16
+ keccak-384, multihash, 0x1c,
17
+ keccak-512, multihash, 0x1d,
18
+ dccp, multiaddr, 0x21,
19
+ murmur3-128, multihash, 0x22,
20
+ murmur3-32, multihash, 0x23,
21
+ ip6, multiaddr, 0x29,
22
+ ip6zone, multiaddr, 0x2a,
23
+ path, namespace, 0x2f, Namespace for string paths. Corresponds to `/` in ASCII.
24
+ multicodec, multiformat, 0x30,
25
+ multihash, multiformat, 0x31,
26
+ multiaddr, multiformat, 0x32,
27
+ multibase, multiformat, 0x33,
28
+ dns, multiaddr, 0x35,
29
+ dns4, multiaddr, 0x36,
30
+ dns6, multiaddr, 0x37,
31
+ dnsaddr, multiaddr, 0x38,
32
+ protobuf, serialization, 0x50, Protocol Buffers
33
+ cbor, serialization, 0x51, CBOR
34
+ raw, ipld, 0x55, raw binary
35
+ dbl-sha2-256, multihash, 0x56,
36
+ rlp, serialization, 0x60, recursive length prefix
37
+ bencode, serialization, 0x63, bencode
38
+ dag-pb, ipld, 0x70, MerkleDAG protobuf
39
+ dag-cbor, ipld, 0x71, MerkleDAG cbor
40
+ libp2p-key, ipld, 0x72, Libp2p Public Key
41
+ git-raw, ipld, 0x78, Raw Git object
42
+ torrent-info, ipld, 0x7b, Torrent file info field (bencoded)
43
+ torrent-file, ipld, 0x7c, Torrent file (bencoded)
44
+ leofcoin-block, ipld, 0x81, Leofcoin Block
45
+ leofcoin-tx, ipld, 0x82, Leofcoin Transaction
46
+ leofcoin-pr, ipld, 0x83, Leofcoin Peer Reputation
47
+ sctp, multiaddr, 0x84,
48
+ eth-block, ipld, 0x90, Ethereum Block (RLP)
49
+ eth-block-list, ipld, 0x91, Ethereum Block List (RLP)
50
+ eth-tx-trie, ipld, 0x92, Ethereum Transaction Trie (Eth-Trie)
51
+ eth-tx, ipld, 0x93, Ethereum Transaction (RLP)
52
+ eth-tx-receipt-trie, ipld, 0x94, Ethereum Transaction Receipt Trie (Eth-Trie)
53
+ eth-tx-receipt, ipld, 0x95, Ethereum Transaction Receipt (RLP)
54
+ eth-state-trie, ipld, 0x96, Ethereum State Trie (Eth-Secure-Trie)
55
+ eth-account-snapshot, ipld, 0x97, Ethereum Account Snapshot (RLP)
56
+ eth-storage-trie, ipld, 0x98, Ethereum Contract Storage Trie (Eth-Secure-Trie)
57
+ bitcoin-block, ipld, 0xb0, Bitcoin Block
58
+ bitcoin-tx, ipld, 0xb1, Bitcoin Tx
59
+ zcash-block, ipld, 0xc0, Zcash Block
60
+ zcash-tx, ipld, 0xc1, Zcash Tx
61
+ stellar-block, ipld, 0xd0, Stellar Block
62
+ stellar-tx, ipld, 0xd1, Stellar Tx
63
+ md4, multihash, 0xd4,
64
+ md5, multihash, 0xd5,
65
+ bmt, multihash, 0xd6, Binary Merkle Tree Hash
66
+ decred-block, ipld, 0xe0, Decred Block
67
+ decred-tx, ipld, 0xe1, Decred Tx
68
+ ipld-ns, namespace, 0xe2, IPLD path
69
+ ipfs-ns, namespace, 0xe3, IPFS path
70
+ swarm-ns, namespace, 0xe4, Swarm path
71
+ ed25519-pub, key, 0xed, Ed25519 public key
72
+ dash-block, ipld, 0xf0, Dash Block
73
+ dash-tx, ipld, 0xf1, Dash Tx
74
+ swarm-manifest, ipld, 0xfa, Swarm Manifest
75
+ swarm-feed, ipld, 0xfb, Swarm Feed
76
+ udp, multiaddr, 0x0111,
77
+ p2p-webrtc-star, multiaddr, 0x0113,
78
+ p2p-webrtc-direct, multiaddr, 0x0114,
79
+ p2p-stardust, multiaddr, 0x0115,
80
+ p2p-circuit, multiaddr, 0x0122,
81
+ dag-json, ipld, 0x0129, MerkleDAG json
82
+ udt, multiaddr, 0x012d,
83
+ utp, multiaddr, 0x012e,
84
+ unix, multiaddr, 0x0190,
85
+ p2p, multiaddr, 0x01a5, libp2p
86
+ ipfs, multiaddr, 0x01a5, libp2p (deprecated)
87
+ https, multiaddr, 0x01bb,
88
+ onion, multiaddr, 0x01bc,
89
+ onion3, multiaddr, 0x01bd,
90
+ garlic64, multiaddr, 0x01be, I2P base64 (raw public key)
91
+ garlic32, multiaddr, 0x01bf, I2P base32 (hashed public key or encoded public key/checksum+optional secret)
92
+ quic, multiaddr, 0x01cc,
93
+ ws, multiaddr, 0x01dd,
94
+ wss, multiaddr, 0x01de,
95
+ p2p-websocket-star, multiaddr, 0x01df,
96
+ http, multiaddr, 0x01e0,
97
+ x11, multihash, 0x1100,
98
+ blake2b-8, multihash, 0xb201, Blake2b consists of 64 output lengths that give different hashes
99
+ blake2b-16, multihash, 0xb202,
100
+ blake2b-24, multihash, 0xb203,
101
+ blake2b-32, multihash, 0xb204,
102
+ blake2b-40, multihash, 0xb205,
103
+ blake2b-48, multihash, 0xb206,
104
+ blake2b-56, multihash, 0xb207,
105
+ blake2b-64, multihash, 0xb208,
106
+ blake2b-72, multihash, 0xb209,
107
+ blake2b-80, multihash, 0xb20a,
108
+ blake2b-88, multihash, 0xb20b,
109
+ blake2b-96, multihash, 0xb20c,
110
+ blake2b-104, multihash, 0xb20d,
111
+ blake2b-112, multihash, 0xb20e,
112
+ blake2b-120, multihash, 0xb20f,
113
+ blake2b-128, multihash, 0xb210,
114
+ blake2b-136, multihash, 0xb211,
115
+ blake2b-144, multihash, 0xb212,
116
+ blake2b-152, multihash, 0xb213,
117
+ blake2b-160, multihash, 0xb214,
118
+ blake2b-168, multihash, 0xb215,
119
+ blake2b-176, multihash, 0xb216,
120
+ blake2b-184, multihash, 0xb217,
121
+ blake2b-192, multihash, 0xb218,
122
+ blake2b-200, multihash, 0xb219,
123
+ blake2b-208, multihash, 0xb21a,
124
+ blake2b-216, multihash, 0xb21b,
125
+ blake2b-224, multihash, 0xb21c,
126
+ blake2b-232, multihash, 0xb21d,
127
+ blake2b-240, multihash, 0xb21e,
128
+ blake2b-248, multihash, 0xb21f,
129
+ blake2b-256, multihash, 0xb220,
130
+ blake2b-264, multihash, 0xb221,
131
+ blake2b-272, multihash, 0xb222,
132
+ blake2b-280, multihash, 0xb223,
133
+ blake2b-288, multihash, 0xb224,
134
+ blake2b-296, multihash, 0xb225,
135
+ blake2b-304, multihash, 0xb226,
136
+ blake2b-312, multihash, 0xb227,
137
+ blake2b-320, multihash, 0xb228,
138
+ blake2b-328, multihash, 0xb229,
139
+ blake2b-336, multihash, 0xb22a,
140
+ blake2b-344, multihash, 0xb22b,
141
+ blake2b-352, multihash, 0xb22c,
142
+ blake2b-360, multihash, 0xb22d,
143
+ blake2b-368, multihash, 0xb22e,
144
+ blake2b-376, multihash, 0xb22f,
145
+ blake2b-384, multihash, 0xb230,
146
+ blake2b-392, multihash, 0xb231,
147
+ blake2b-400, multihash, 0xb232,
148
+ blake2b-408, multihash, 0xb233,
149
+ blake2b-416, multihash, 0xb234,
150
+ blake2b-424, multihash, 0xb235,
151
+ blake2b-432, multihash, 0xb236,
152
+ blake2b-440, multihash, 0xb237,
153
+ blake2b-448, multihash, 0xb238,
154
+ blake2b-456, multihash, 0xb239,
155
+ blake2b-464, multihash, 0xb23a,
156
+ blake2b-472, multihash, 0xb23b,
157
+ blake2b-480, multihash, 0xb23c,
158
+ blake2b-488, multihash, 0xb23d,
159
+ blake2b-496, multihash, 0xb23e,
160
+ blake2b-504, multihash, 0xb23f,
161
+ blake2b-512, multihash, 0xb240,
162
+ blake2s-8, multihash, 0xb241, Blake2s consists of 32 output lengths that give different hashes
163
+ blake2s-16, multihash, 0xb242,
164
+ blake2s-24, multihash, 0xb243,
165
+ blake2s-32, multihash, 0xb244,
166
+ blake2s-40, multihash, 0xb245,
167
+ blake2s-48, multihash, 0xb246,
168
+ blake2s-56, multihash, 0xb247,
169
+ blake2s-64, multihash, 0xb248,
170
+ blake2s-72, multihash, 0xb249,
171
+ blake2s-80, multihash, 0xb24a,
172
+ blake2s-88, multihash, 0xb24b,
173
+ blake2s-96, multihash, 0xb24c,
174
+ blake2s-104, multihash, 0xb24d,
175
+ blake2s-112, multihash, 0xb24e,
176
+ blake2s-120, multihash, 0xb24f,
177
+ blake2s-128, multihash, 0xb250,
178
+ blake2s-136, multihash, 0xb251,
179
+ blake2s-144, multihash, 0xb252,
180
+ blake2s-152, multihash, 0xb253,
181
+ blake2s-160, multihash, 0xb254,
182
+ blake2s-168, multihash, 0xb255,
183
+ blake2s-176, multihash, 0xb256,
184
+ blake2s-184, multihash, 0xb257,
185
+ blake2s-192, multihash, 0xb258,
186
+ blake2s-200, multihash, 0xb259,
187
+ blake2s-208, multihash, 0xb25a,
188
+ blake2s-216, multihash, 0xb25b,
189
+ blake2s-224, multihash, 0xb25c,
190
+ blake2s-232, multihash, 0xb25d,
191
+ blake2s-240, multihash, 0xb25e,
192
+ blake2s-248, multihash, 0xb25f,
193
+ blake2s-256, multihash, 0xb260,
194
+ skein256-8, multihash, 0xb301, Skein256 consists of 32 output lengths that give different hashes
195
+ skein256-16, multihash, 0xb302,
196
+ skein256-24, multihash, 0xb303,
197
+ skein256-32, multihash, 0xb304,
198
+ skein256-40, multihash, 0xb305,
199
+ skein256-48, multihash, 0xb306,
200
+ skein256-56, multihash, 0xb307,
201
+ skein256-64, multihash, 0xb308,
202
+ skein256-72, multihash, 0xb309,
203
+ skein256-80, multihash, 0xb30a,
204
+ skein256-88, multihash, 0xb30b,
205
+ skein256-96, multihash, 0xb30c,
206
+ skein256-104, multihash, 0xb30d,
207
+ skein256-112, multihash, 0xb30e,
208
+ skein256-120, multihash, 0xb30f,
209
+ skein256-128, multihash, 0xb310,
210
+ skein256-136, multihash, 0xb311,
211
+ skein256-144, multihash, 0xb312,
212
+ skein256-152, multihash, 0xb313,
213
+ skein256-160, multihash, 0xb314,
214
+ skein256-168, multihash, 0xb315,
215
+ skein256-176, multihash, 0xb316,
216
+ skein256-184, multihash, 0xb317,
217
+ skein256-192, multihash, 0xb318,
218
+ skein256-200, multihash, 0xb319,
219
+ skein256-208, multihash, 0xb31a,
220
+ skein256-216, multihash, 0xb31b,
221
+ skein256-224, multihash, 0xb31c,
222
+ skein256-232, multihash, 0xb31d,
223
+ skein256-240, multihash, 0xb31e,
224
+ skein256-248, multihash, 0xb31f,
225
+ skein256-256, multihash, 0xb320,
226
+ skein512-8, multihash, 0xb321, Skein512 consists of 64 output lengths that give different hashes
227
+ skein512-16, multihash, 0xb322,
228
+ skein512-24, multihash, 0xb323,
229
+ skein512-32, multihash, 0xb324,
230
+ skein512-40, multihash, 0xb325,
231
+ skein512-48, multihash, 0xb326,
232
+ skein512-56, multihash, 0xb327,
233
+ skein512-64, multihash, 0xb328,
234
+ skein512-72, multihash, 0xb329,
235
+ skein512-80, multihash, 0xb32a,
236
+ skein512-88, multihash, 0xb32b,
237
+ skein512-96, multihash, 0xb32c,
238
+ skein512-104, multihash, 0xb32d,
239
+ skein512-112, multihash, 0xb32e,
240
+ skein512-120, multihash, 0xb32f,
241
+ skein512-128, multihash, 0xb330,
242
+ skein512-136, multihash, 0xb331,
243
+ skein512-144, multihash, 0xb332,
244
+ skein512-152, multihash, 0xb333,
245
+ skein512-160, multihash, 0xb334,
246
+ skein512-168, multihash, 0xb335,
247
+ skein512-176, multihash, 0xb336,
248
+ skein512-184, multihash, 0xb337,
249
+ skein512-192, multihash, 0xb338,
250
+ skein512-200, multihash, 0xb339,
251
+ skein512-208, multihash, 0xb33a,
252
+ skein512-216, multihash, 0xb33b,
253
+ skein512-224, multihash, 0xb33c,
254
+ skein512-232, multihash, 0xb33d,
255
+ skein512-240, multihash, 0xb33e,
256
+ skein512-248, multihash, 0xb33f,
257
+ skein512-256, multihash, 0xb340,
258
+ skein512-264, multihash, 0xb341,
259
+ skein512-272, multihash, 0xb342,
260
+ skein512-280, multihash, 0xb343,
261
+ skein512-288, multihash, 0xb344,
262
+ skein512-296, multihash, 0xb345,
263
+ skein512-304, multihash, 0xb346,
264
+ skein512-312, multihash, 0xb347,
265
+ skein512-320, multihash, 0xb348,
266
+ skein512-328, multihash, 0xb349,
267
+ skein512-336, multihash, 0xb34a,
268
+ skein512-344, multihash, 0xb34b,
269
+ skein512-352, multihash, 0xb34c,
270
+ skein512-360, multihash, 0xb34d,
271
+ skein512-368, multihash, 0xb34e,
272
+ skein512-376, multihash, 0xb34f,
273
+ skein512-384, multihash, 0xb350,
274
+ skein512-392, multihash, 0xb351,
275
+ skein512-400, multihash, 0xb352,
276
+ skein512-408, multihash, 0xb353,
277
+ skein512-416, multihash, 0xb354,
278
+ skein512-424, multihash, 0xb355,
279
+ skein512-432, multihash, 0xb356,
280
+ skein512-440, multihash, 0xb357,
281
+ skein512-448, multihash, 0xb358,
282
+ skein512-456, multihash, 0xb359,
283
+ skein512-464, multihash, 0xb35a,
284
+ skein512-472, multihash, 0xb35b,
285
+ skein512-480, multihash, 0xb35c,
286
+ skein512-488, multihash, 0xb35d,
287
+ skein512-496, multihash, 0xb35e,
288
+ skein512-504, multihash, 0xb35f,
289
+ skein512-512, multihash, 0xb360,
290
+ skein1024-8, multihash, 0xb361, Skein1024 consists of 128 output lengths that give different hashes
291
+ skein1024-16, multihash, 0xb362,
292
+ skein1024-24, multihash, 0xb363,
293
+ skein1024-32, multihash, 0xb364,
294
+ skein1024-40, multihash, 0xb365,
295
+ skein1024-48, multihash, 0xb366,
296
+ skein1024-56, multihash, 0xb367,
297
+ skein1024-64, multihash, 0xb368,
298
+ skein1024-72, multihash, 0xb369,
299
+ skein1024-80, multihash, 0xb36a,
300
+ skein1024-88, multihash, 0xb36b,
301
+ skein1024-96, multihash, 0xb36c,
302
+ skein1024-104, multihash, 0xb36d,
303
+ skein1024-112, multihash, 0xb36e,
304
+ skein1024-120, multihash, 0xb36f,
305
+ skein1024-128, multihash, 0xb370,
306
+ skein1024-136, multihash, 0xb371,
307
+ skein1024-144, multihash, 0xb372,
308
+ skein1024-152, multihash, 0xb373,
309
+ skein1024-160, multihash, 0xb374,
310
+ skein1024-168, multihash, 0xb375,
311
+ skein1024-176, multihash, 0xb376,
312
+ skein1024-184, multihash, 0xb377,
313
+ skein1024-192, multihash, 0xb378,
314
+ skein1024-200, multihash, 0xb379,
315
+ skein1024-208, multihash, 0xb37a,
316
+ skein1024-216, multihash, 0xb37b,
317
+ skein1024-224, multihash, 0xb37c,
318
+ skein1024-232, multihash, 0xb37d,
319
+ skein1024-240, multihash, 0xb37e,
320
+ skein1024-248, multihash, 0xb37f,
321
+ skein1024-256, multihash, 0xb380,
322
+ skein1024-264, multihash, 0xb381,
323
+ skein1024-272, multihash, 0xb382,
324
+ skein1024-280, multihash, 0xb383,
325
+ skein1024-288, multihash, 0xb384,
326
+ skein1024-296, multihash, 0xb385,
327
+ skein1024-304, multihash, 0xb386,
328
+ skein1024-312, multihash, 0xb387,
329
+ skein1024-320, multihash, 0xb388,
330
+ skein1024-328, multihash, 0xb389,
331
+ skein1024-336, multihash, 0xb38a,
332
+ skein1024-344, multihash, 0xb38b,
333
+ skein1024-352, multihash, 0xb38c,
334
+ skein1024-360, multihash, 0xb38d,
335
+ skein1024-368, multihash, 0xb38e,
336
+ skein1024-376, multihash, 0xb38f,
337
+ skein1024-384, multihash, 0xb390,
338
+ skein1024-392, multihash, 0xb391,
339
+ skein1024-400, multihash, 0xb392,
340
+ skein1024-408, multihash, 0xb393,
341
+ skein1024-416, multihash, 0xb394,
342
+ skein1024-424, multihash, 0xb395,
343
+ skein1024-432, multihash, 0xb396,
344
+ skein1024-440, multihash, 0xb397,
345
+ skein1024-448, multihash, 0xb398,
346
+ skein1024-456, multihash, 0xb399,
347
+ skein1024-464, multihash, 0xb39a,
348
+ skein1024-472, multihash, 0xb39b,
349
+ skein1024-480, multihash, 0xb39c,
350
+ skein1024-488, multihash, 0xb39d,
351
+ skein1024-496, multihash, 0xb39e,
352
+ skein1024-504, multihash, 0xb39f,
353
+ skein1024-512, multihash, 0xb3a0,
354
+ skein1024-520, multihash, 0xb3a1,
355
+ skein1024-528, multihash, 0xb3a2,
356
+ skein1024-536, multihash, 0xb3a3,
357
+ skein1024-544, multihash, 0xb3a4,
358
+ skein1024-552, multihash, 0xb3a5,
359
+ skein1024-560, multihash, 0xb3a6,
360
+ skein1024-568, multihash, 0xb3a7,
361
+ skein1024-576, multihash, 0xb3a8,
362
+ skein1024-584, multihash, 0xb3a9,
363
+ skein1024-592, multihash, 0xb3aa,
364
+ skein1024-600, multihash, 0xb3ab,
365
+ skein1024-608, multihash, 0xb3ac,
366
+ skein1024-616, multihash, 0xb3ad,
367
+ skein1024-624, multihash, 0xb3ae,
368
+ skein1024-632, multihash, 0xb3af,
369
+ skein1024-640, multihash, 0xb3b0,
370
+ skein1024-648, multihash, 0xb3b1,
371
+ skein1024-656, multihash, 0xb3b2,
372
+ skein1024-664, multihash, 0xb3b3,
373
+ skein1024-672, multihash, 0xb3b4,
374
+ skein1024-680, multihash, 0xb3b5,
375
+ skein1024-688, multihash, 0xb3b6,
376
+ skein1024-696, multihash, 0xb3b7,
377
+ skein1024-704, multihash, 0xb3b8,
378
+ skein1024-712, multihash, 0xb3b9,
379
+ skein1024-720, multihash, 0xb3ba,
380
+ skein1024-728, multihash, 0xb3bb,
381
+ skein1024-736, multihash, 0xb3bc,
382
+ skein1024-744, multihash, 0xb3bd,
383
+ skein1024-752, multihash, 0xb3be,
384
+ skein1024-760, multihash, 0xb3bf,
385
+ skein1024-768, multihash, 0xb3c0,
386
+ skein1024-776, multihash, 0xb3c1,
387
+ skein1024-784, multihash, 0xb3c2,
388
+ skein1024-792, multihash, 0xb3c3,
389
+ skein1024-800, multihash, 0xb3c4,
390
+ skein1024-808, multihash, 0xb3c5,
391
+ skein1024-816, multihash, 0xb3c6,
392
+ skein1024-824, multihash, 0xb3c7,
393
+ skein1024-832, multihash, 0xb3c8,
394
+ skein1024-840, multihash, 0xb3c9,
395
+ skein1024-848, multihash, 0xb3ca,
396
+ skein1024-856, multihash, 0xb3cb,
397
+ skein1024-864, multihash, 0xb3cc,
398
+ skein1024-872, multihash, 0xb3cd,
399
+ skein1024-880, multihash, 0xb3ce,
400
+ skein1024-888, multihash, 0xb3cf,
401
+ skein1024-896, multihash, 0xb3d0,
402
+ skein1024-904, multihash, 0xb3d1,
403
+ skein1024-912, multihash, 0xb3d2,
404
+ skein1024-920, multihash, 0xb3d3,
405
+ skein1024-928, multihash, 0xb3d4,
406
+ skein1024-936, multihash, 0xb3d5,
407
+ skein1024-944, multihash, 0xb3d6,
408
+ skein1024-952, multihash, 0xb3d7,
409
+ skein1024-960, multihash, 0xb3d8,
410
+ skein1024-968, multihash, 0xb3d9,
411
+ skein1024-976, multihash, 0xb3da,
412
+ skein1024-984, multihash, 0xb3db,
413
+ skein1024-992, multihash, 0xb3dc,
414
+ skein1024-1000, multihash, 0xb3dd,
415
+ skein1024-1008, multihash, 0xb3de,
416
+ skein1024-1016, multihash, 0xb3df,
417
+ skein1024-1024, multihash, 0xb3e0,
418
+ holochain-adr-v0, holochain, 0x807124, Holochain v0 address + 8 R-S (63 x Base-32)
419
+ holochain-adr-v1, holochain, 0x817124, Holochain v1 address + 8 R-S (63 x Base-32)
420
+ holochain-key-v0, holochain, 0x947124, Holochain v0 public key + 8 R-S (63 x Base-32)
421
+ holochain-key-v1, holochain, 0x957124, Holochain v1 public key + 8 R-S (63 x Base-32)
422
+ holochain-sig-v0, holochain, 0xa27124, Holochain v0 signature + 8 R-S (63 x Base-32)
423
+ holochain-sig-v1, holochain, 0xa37124, Holochain v1 signature + 8 R-S (63 x Base-32)
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'multicodecs/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'multicodecs'
9
+ spec.version = Multicodecs::VERSION
10
+ spec.authors = ['Derk-Jan Karrenbeld']
11
+ spec.email = ['derk-jan+github@karrenbeld.info']
12
+
13
+ spec.summary = 'Ruby implementation of the multicodec specification'
14
+ spec.description = %q(
15
+ This gem provides a PORO of the multicodec table for use with other
16
+ multiformat ruby gems.
17
+ ).strip
18
+ spec.homepage = 'https://github.com/SleeplessByte/ruby-multicodec'
19
+
20
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
21
+ # 'allowed_push_host' to allow pushing to a single host or delete this section
22
+ # to allow pushing to any host.
23
+ if spec.respond_to?(:metadata)
24
+ spec.metadata['homepage_uri'] = spec.homepage
25
+ spec.metadata['source_code_uri'] = 'https://github.com/SleeplessByte/ruby-multicodec'
26
+ spec.metadata['changelog_uri'] = spec.metadata['source_code_uri'] +
27
+ '/blog/master/CHANGELOG.md'
28
+ else
29
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
30
+ 'public gem pushes.'
31
+ end
32
+
33
+ # Specify which files should be added to the gem when it is released.
34
+ # The `git ls-files -z` loads the files in the RubyGem that have been added
35
+ # into git.
36
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
37
+ `git ls-files -z`.split("\x0").reject do |f|
38
+ f.match(%r{^(test|spec|features)/})
39
+ end
40
+ end
41
+ spec.bindir = 'exe'
42
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
43
+ spec.require_paths = ['lib']
44
+
45
+ spec.add_development_dependency 'bundler', '~> 2'
46
+ spec.add_development_dependency 'minitest', '~> 5.0'
47
+ spec.add_development_dependency 'rake', '~> 10.0'
48
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: multicodecs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Derk-Jan Karrenbeld
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-06-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: |-
56
+ This gem provides a PORO of the multicodec table for use with other
57
+ multiformat ruby gems.
58
+ email:
59
+ - derk-jan+github@karrenbeld.info
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - lib/multicodecs.rb
72
+ - lib/multicodecs/bare.rb
73
+ - lib/multicodecs/registry.rb
74
+ - lib/multicodecs/version.rb
75
+ - lib/table.csv
76
+ - multicodecs.gemspec
77
+ homepage: https://github.com/SleeplessByte/ruby-multicodec
78
+ licenses: []
79
+ metadata:
80
+ homepage_uri: https://github.com/SleeplessByte/ruby-multicodec
81
+ source_code_uri: https://github.com/SleeplessByte/ruby-multicodec
82
+ changelog_uri: https://github.com/SleeplessByte/ruby-multicodec/blog/master/CHANGELOG.md
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubygems_version: 3.0.3
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Ruby implementation of the multicodec specification
102
+ test_files: []