multibases 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +9 -9
- data/CHANGELOG.md +5 -0
- data/bin/setup +8 -8
- data/lib/multibases/byte_array.rb +14 -6
- data/lib/multibases/version.rb +1 -1
- data/lib/table.csv +23 -23
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1e42541d582b7f99201f0d4c138908a637db6e9f1e2ea84c7403ecfce50f115
|
|
4
|
+
data.tar.gz: d27bc8b607f19bcc9d19bb170f0a66248da7db4e4e3564cd3eb472c79c0b767a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ff27a35d840e6788fc931459db32ec021961fbbeb2b8577e75e86593b8710d818e60182e36f6fbdb9fe7c7c49d04d83f34f5336b5048bf715dd04a8c2d853f0
|
|
7
|
+
data.tar.gz: 8ff449c25f5e347d0c966d6238c38c70a7088a9f27af3a0c8907c922eb47a8335fd81e797ce3ce6d9afb914fe3d6c7dc1a016cdb36e8651f9d463fc015656791
|
data/.gitignore
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/.bundle/
|
|
2
|
-
/.yardoc
|
|
3
|
-
/_yardoc/
|
|
4
|
-
/coverage/
|
|
5
|
-
/doc/
|
|
6
|
-
/pkg/
|
|
7
|
-
/spec/reports/
|
|
8
|
-
/tmp/
|
|
9
|
-
Gemfile.lock
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/_yardoc/
|
|
4
|
+
/coverage/
|
|
5
|
+
/doc/
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/tmp/
|
|
9
|
+
Gemfile.lock
|
data/CHANGELOG.md
CHANGED
data/bin/setup
CHANGED
|
@@ -1,8 +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
|
|
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
|
|
@@ -15,10 +15,6 @@ module Multibases
|
|
|
15
15
|
__getobj__.hash
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def eql?(other)
|
|
19
|
-
other.to_s.eql?(to_s)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
18
|
def to_arr
|
|
23
19
|
__getobj__.dup
|
|
24
20
|
end
|
|
@@ -50,6 +46,14 @@ module Multibases
|
|
|
50
46
|
pack('C*').force_encoding(encoding)
|
|
51
47
|
end
|
|
52
48
|
|
|
49
|
+
def to_ascii_str
|
|
50
|
+
to_str(Encoding::US_ASCII)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def to_utf8_str
|
|
54
|
+
to_str(Encoding::UTF_8)
|
|
55
|
+
end
|
|
56
|
+
|
|
53
57
|
def chomp!(ord)
|
|
54
58
|
return self unless ord
|
|
55
59
|
|
|
@@ -76,8 +80,12 @@ module Multibases
|
|
|
76
80
|
pack('C*').force_encoding(encoding)
|
|
77
81
|
end
|
|
78
82
|
|
|
79
|
-
def
|
|
80
|
-
to_str(
|
|
83
|
+
def to_ascii_str
|
|
84
|
+
to_str(Encoding::US_ASCII)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def to_utf8_str
|
|
88
|
+
to_str(Encoding::UTF_8)
|
|
81
89
|
end
|
|
82
90
|
|
|
83
91
|
alias to_s to_str
|
data/lib/multibases/version.rb
CHANGED
data/lib/table.csv
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
encoding, code, description
|
|
2
|
-
identity, 0x00, 8-bit binary (encoder and decoder keeps data unmodified)
|
|
3
|
-
base1, 1, unary (11111)
|
|
4
|
-
base2, 0, binary (01010101)
|
|
5
|
-
base8, 7, octal
|
|
6
|
-
base10, 9, decimal
|
|
7
|
-
base16, f, hexadecimal
|
|
8
|
-
base16upper, F, hexadecimal
|
|
9
|
-
base32hex, v, rfc4648 no padding - highest char
|
|
10
|
-
base32hexupper, V, rfc4648 no padding - highest char
|
|
11
|
-
base32hexpad, t, rfc4648 with padding
|
|
12
|
-
base32hexpadupper, T, rfc4648 with padding
|
|
13
|
-
base32, b, rfc4648 no padding
|
|
14
|
-
base32upper, B, rfc4648 no padding
|
|
15
|
-
base32pad, c, rfc4648 with padding
|
|
16
|
-
base32padupper, C, rfc4648 with padding
|
|
17
|
-
base32z, h, z-base-32 (used by Tahoe-LAFS)
|
|
18
|
-
base58flickr, Z, base58 flicker
|
|
19
|
-
base58btc, z, base58 bitcoin
|
|
20
|
-
base64, m, rfc4648 no padding
|
|
21
|
-
base64pad, M, rfc4648 with padding - MIME encoding
|
|
22
|
-
base64url, u, rfc4648 no padding
|
|
23
|
-
base64urlpad, U, rfc4648 with padding
|
|
1
|
+
encoding, code, description
|
|
2
|
+
identity, 0x00, 8-bit binary (encoder and decoder keeps data unmodified)
|
|
3
|
+
base1, 1, unary (11111)
|
|
4
|
+
base2, 0, binary (01010101)
|
|
5
|
+
base8, 7, octal
|
|
6
|
+
base10, 9, decimal
|
|
7
|
+
base16, f, hexadecimal
|
|
8
|
+
base16upper, F, hexadecimal
|
|
9
|
+
base32hex, v, rfc4648 no padding - highest char
|
|
10
|
+
base32hexupper, V, rfc4648 no padding - highest char
|
|
11
|
+
base32hexpad, t, rfc4648 with padding
|
|
12
|
+
base32hexpadupper, T, rfc4648 with padding
|
|
13
|
+
base32, b, rfc4648 no padding
|
|
14
|
+
base32upper, B, rfc4648 no padding
|
|
15
|
+
base32pad, c, rfc4648 with padding
|
|
16
|
+
base32padupper, C, rfc4648 with padding
|
|
17
|
+
base32z, h, z-base-32 (used by Tahoe-LAFS)
|
|
18
|
+
base58flickr, Z, base58 flicker
|
|
19
|
+
base58btc, z, base58 bitcoin
|
|
20
|
+
base64, m, rfc4648 no padding
|
|
21
|
+
base64pad, M, rfc4648 with padding - MIME encoding
|
|
22
|
+
base64url, u, rfc4648 no padding
|
|
23
|
+
base64urlpad, U, rfc4648 with padding
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multibases
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Derk-Jan Karrenbeld
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
requirements: []
|
|
112
|
-
rubygems_version: 3.0.
|
|
112
|
+
rubygems_version: 3.0.3
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: Ruby implementation of the multibase specification
|