base32-alphabets 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/base32-alphabets.rb +2 -2
- data/lib/base32-alphabets/base.rb +5 -4
- data/lib/base32-alphabets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad6b4b08320d7b50f69cd88881277c0f32adcdc
|
4
|
+
data.tar.gz: 78ac1976300053f0ba0348c6a880f1765843897d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20158649f45959d3cdf819445d4e3d028f6b343e82fabc2f21650442b5862619239f87893190d4efe5a1e7ae24f9a49dde9623ead391c734752d353a7b217005
|
7
|
+
data.tar.gz: acbe509305d8655b1c9cd8ae0dd71d5ef37bb896d87e0a67a526b7f6a410795693fda00329a8acfc2c1b91e43e868856d776c23f237f08f8e2e7ec38f8392365
|
data/lib/base32-alphabets.rb
CHANGED
@@ -9,14 +9,15 @@ class Base
|
|
9
9
|
|
10
10
|
def self.bytes( num_or_str )
|
11
11
|
if num_or_str.is_a? String
|
12
|
-
str
|
13
|
-
|
12
|
+
str = num_or_str
|
13
|
+
bytes = _decode( str )
|
14
14
|
else # assume number
|
15
|
-
num
|
15
|
+
num = num_or_str
|
16
|
+
bytes = Base32._bytes( num )
|
16
17
|
end
|
17
|
-
Base32._bytes( num )
|
18
18
|
end
|
19
19
|
|
20
|
+
|
20
21
|
# Converts a base10 integer to a base32 string.
|
21
22
|
def self.encode( num_or_bytes )
|
22
23
|
if num_or_bytes.is_a? Array
|