multibases 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0305ee658756f0f00d70b606c22c24133ba5e91a0aa494dc15d2a314ebeb3942
4
- data.tar.gz: d243731352a43fa3398ad6a51900632af5212d71fcc540b63d3888f25a4630a5
3
+ metadata.gz: a1e42541d582b7f99201f0d4c138908a637db6e9f1e2ea84c7403ecfce50f115
4
+ data.tar.gz: d27bc8b607f19bcc9d19bb170f0a66248da7db4e4e3564cd3eb472c79c0b767a
5
5
  SHA512:
6
- metadata.gz: 553a55fd1fd447709f5c9a334907b1f95e30e3121afaad30c753f9f6388367cdd56f7aa710ea50ac1b4d34556979657997a041d86008b4f532ff3451b3092ad0
7
- data.tar.gz: 935370e50f81face4ed193fd9b96ad9353ccdded9011ff7c8fc3b1d885846bb4e40f7541a0d7d7034c7b9d089c4f0beef0dbd8ae7b98c843e7052b78e72f25dc
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
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+
5
+ - Add tests for `ByteArray`
6
+ - Add `to_utf8_str` and `to_ascii_str` convenience
7
+
3
8
  ## 0.3.1
4
9
 
5
10
  - Add tests for wrappers
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 force_encoding(*args)
80
- to_str(*args)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Multibases
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
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.1
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-25 00:00:00.000000000 Z
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.2
112
+ rubygems_version: 3.0.3
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Ruby implementation of the multibase specification