sixarm_ruby_xid 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +8 -6
- data/VERSION +1 -1
- data/lib/sixarm_ruby_xid.rb +2 -2
- data/test/sixarm_ruby_xid_test.rb +23 -10
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 937b657f00fc33f19a4a5b5bacd1c76c27f25746
|
4
|
+
data.tar.gz: b5fbbe787c33fdeb8a40cefad62ca454f54d13a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a8c2e731f7b725d182a7540293f8188a54d5d551c1ca5945da0d0ed7b83754865e8b8ba88d88a09430ed13e6016c0a547a07089165690ff4b8bf55238b2c1fa
|
7
|
+
data.tar.gz: 19ff82defe380b521039b295c13bfc2c76a9c04ffd05b3954980a589542a69eb3259a226a766770cde0c3048231650603bcec55bf2e760f01a6ec33efa8743b1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# SixArm.com » Ruby » <br> XID excellent identifier
|
2
2
|
|
3
|
-
[![Code Climate](https://codeclimate.com/github/SixArm/xid.png)](https://codeclimate.com/github/SixArm/
|
4
|
-
[![Build Status](https://travis-ci.org/SixArm/xid.png)](https://travis-ci.org/SixArm/
|
3
|
+
[![Code Climate](https://codeclimate.com/github/SixArm/xid.png)](https://codeclimate.com/github/SixArm/sixarm_ruby_xid)
|
4
|
+
[![Build Status](https://travis-ci.org/SixArm/xid.png)](https://travis-ci.org/SixArm/sixarm_ruby_xid)
|
5
5
|
|
6
6
|
* Doc: <http://sixarm.com/sixarm_ruby_xid/doc>
|
7
7
|
* Gem: <http://rubygems.org/gems/sixarm_ruby_xid>
|
@@ -39,7 +39,7 @@ Install:
|
|
39
39
|
|
40
40
|
Bundler:
|
41
41
|
|
42
|
-
gem "sixarm_ruby_xid", ">=3.
|
42
|
+
gem "sixarm_ruby_xid", ">=3.1.0", "<4"
|
43
43
|
|
44
44
|
Require:
|
45
45
|
|
@@ -63,8 +63,9 @@ To install with high security:
|
|
63
63
|
|
64
64
|
Methods:
|
65
65
|
|
66
|
-
* `XID.new`:
|
67
|
-
* `XID
|
66
|
+
* `XID.new`: create an XID string initialized to a random string.
|
67
|
+
* `XID.new(s): create an XID initialized to the given string.
|
68
|
+
* `XID#digest`: return a SHA256 digest as a 64-character string.
|
68
69
|
|
69
70
|
Notes:
|
70
71
|
|
@@ -121,7 +122,8 @@ Some databases have specialize fields for 128 bit values, such as PostgreSQL and
|
|
121
122
|
|
122
123
|
## Changes
|
123
124
|
|
124
|
-
* 2015-02-
|
125
|
+
* 2015-02-12 3.1.0 Add #digest.
|
126
|
+
* 2015-02-11 3.0.0 Upgrade to XID.
|
125
127
|
* 2013-08-20 2.1.0 Add #next to enable using this as an enumeration.
|
126
128
|
* 2013-08-18 2.0.0 Upgrade for Ruby 2.0.0; add .length and .choices methods.
|
127
129
|
* 2012-03-21 1.4.0 Upgrade for Ruby 1.9.3, minitest/spec, and improved docs.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.0
|
data/lib/sixarm_ruby_xid.rb
CHANGED
@@ -9,18 +9,31 @@ describe XID do
|
|
9
9
|
|
10
10
|
describe "#new" do
|
11
11
|
|
12
|
-
|
13
|
-
xid = XID.new
|
14
|
-
xid.must_match /\A[0-9a-f]{32}\z/
|
15
|
-
end
|
12
|
+
describe "with initialize defaults" do
|
16
13
|
|
17
|
-
|
18
|
-
seen = Set.new
|
19
|
-
99999.times.each{
|
14
|
+
it "is a string with the correct length and characters" do
|
20
15
|
xid = XID.new
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
xid.must_match /\A[0-9a-f]{32}\z/
|
17
|
+
end
|
18
|
+
|
19
|
+
it "is always different" do
|
20
|
+
seen = Set.new
|
21
|
+
99999.times.each{
|
22
|
+
xid = XID.new
|
23
|
+
seen.include?(xid).must_equal false
|
24
|
+
seen.add(xid)
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "with initialize string" do
|
31
|
+
|
32
|
+
it "sets" do
|
33
|
+
xid = XID.new("foo")
|
34
|
+
xid.must_equal("foo")
|
35
|
+
end
|
36
|
+
|
24
37
|
end
|
25
38
|
|
26
39
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|