proquint 0.0.1 → 0.0.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/.travis.yml +3 -0
- data/README.md +3 -0
- data/lib/proquint.rb +4 -0
- data/lib/proquint/version.rb +1 -1
- data/proquint.gemspec +4 -0
- data/test/proquint_test.rb +4 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d7038678f9248642bcca441202e98040e722789
|
4
|
+
data.tar.gz: c89a9517d7b243439014768606dd17a40796383d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd342483b4939ed2973d178ce5e42d96de6c6d25dacf677dae301900c71b163d432925bcf91e4223adc6df79d4018836a1fe3253cb1aefd2392fc60d93f2a406
|
7
|
+
data.tar.gz: 144356fd69060a43d4e896c9b1464d64ea02b8490ec8115d76cacd1d1db8935210d0ee1f461ed87ce7e618255ca20b3cd8967c760c24c3b76e0d9123cd9142c6
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -38,3 +38,6 @@ Or install it yourself as:
|
|
38
38
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
39
39
|
4. Push to the branch (`git push origin my-new-feature`)
|
40
40
|
5. Create a new Pull Request
|
41
|
+
|
42
|
+
[](https://travis-ci.org/bjjb/proquint)
|
data/lib/proquint.rb
CHANGED
@@ -21,6 +21,10 @@ module Proquint
|
|
21
21
|
DQUAD_PATTERN = /^(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})$/
|
22
22
|
HEX_PATTERN = /^x(\h+)$/
|
23
23
|
|
24
|
+
def str2words(string)
|
25
|
+
string.bytes
|
26
|
+
end
|
27
|
+
|
24
28
|
def dquad2hex(dquad)
|
25
29
|
if dquad =~ DQUAD_PATTERN
|
26
30
|
i = (($1.to_i << 24) + ($2.to_i << 16) + ($3.to_i << 8) + $4.to_i)
|
data/lib/proquint/version.rb
CHANGED
data/proquint.gemspec
CHANGED
@@ -9,6 +9,10 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["JJ Buckley"]
|
10
10
|
spec.email = ["jj@bjjb.org"]
|
11
11
|
spec.summary = %q{Readable, spellable, pronounceable identifiers}
|
12
|
+
spec.description = <<-DESC
|
13
|
+
A proquint is a readable, spellable, pronouncable identifier that can be
|
14
|
+
encoded back to a number. See http://arxiv.org/html/0901.4016.
|
15
|
+
DESC
|
12
16
|
spec.homepage = "http://bjjb.github.io/proquint"
|
13
17
|
spec.license = "MIT"
|
14
18
|
|
data/test/proquint_test.rb
CHANGED
@@ -35,6 +35,10 @@ describe Proquint do
|
|
35
35
|
Proquint.encode(0x1234567890abcdef).must_equal 'damuh-jinum-nafor-suloz'
|
36
36
|
end
|
37
37
|
|
38
|
+
it "can encode strings" do
|
39
|
+
Proquint.encode("Hello").must_equal 'badam-badoj-bados-bados-badoz'
|
40
|
+
end
|
41
|
+
|
38
42
|
it "can encode and decode IP addresses" do
|
39
43
|
Proquint.encode("192.168.1.1").must_equal "safom-bahad"
|
40
44
|
Proquint.decode("safom-bahad").must_equal [49320, 257]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proquint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JJ Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,9 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 5.4.3
|
55
|
-
description:
|
55
|
+
description: |
|
56
|
+
A proquint is a readable, spellable, pronouncable identifier that can be
|
57
|
+
encoded back to a number. See http://arxiv.org/html/0901.4016.
|
56
58
|
email:
|
57
59
|
- jj@bjjb.org
|
58
60
|
executables: []
|
@@ -60,6 +62,7 @@ extensions: []
|
|
60
62
|
extra_rdoc_files: []
|
61
63
|
files:
|
62
64
|
- ".gitignore"
|
65
|
+
- ".travis.yml"
|
63
66
|
- Gemfile
|
64
67
|
- LICENSE.txt
|
65
68
|
- README.md
|
@@ -89,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
92
|
version: '0'
|
90
93
|
requirements: []
|
91
94
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.5.1
|
93
96
|
signing_key:
|
94
97
|
specification_version: 4
|
95
98
|
summary: Readable, spellable, pronounceable identifiers
|