base_n 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/base_n.rb +5 -1
- data/lib/base_n/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc44f904032ae1d89015105c51a091e95aeaf017
|
4
|
+
data.tar.gz: f0d58f083f5e9943ce7c78e25bdac670d0341a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 229c56c05698f09800d474508445a94cc5f0f4d0d92fc93b4a33d4079af6e5ee7ecc5c3d82e98e57558d9bf70a4108c239b14156c230260d3c8a8f9246338fcb
|
7
|
+
data.tar.gz: 1f844cddf8311057ed0010eb7833cbd693bf035234c272a321da7e19739a21dbc7498372c3fd92935a31ec7a2e05dc02bd45c5f87d9c85d31c2a5afc2d8bc391
|
data/lib/base_n.rb
CHANGED
@@ -16,7 +16,7 @@ module BaseN
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class Encoder
|
19
|
-
PRIMITIVES = ((0..9).collect { |i| i.to_s } + ('A'..'Z').to_a + ('a'..'z').to_a + %w(- _)).map(&:freeze).freeze
|
19
|
+
PRIMITIVES = ((0..9).collect { |i| i.to_s } + ('A'..'Z').to_a + ('a'..'z').to_a + %w(! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~)).map(&:freeze).freeze
|
20
20
|
|
21
21
|
attr_accessor :base
|
22
22
|
|
@@ -26,6 +26,10 @@ module BaseN
|
|
26
26
|
raise "I only support up to base #{primitives.size}" if base > primitives.size
|
27
27
|
end
|
28
28
|
|
29
|
+
def self.highest_supported
|
30
|
+
new PRIMITIVES.size
|
31
|
+
end
|
32
|
+
|
29
33
|
def case_sensitive?
|
30
34
|
base > 36
|
31
35
|
end
|
data/lib/base_n/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base_n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07
|
11
|
+
date: 2014-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|