sixarm_ruby_xid 3.2.0 → 3.3.0

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
  SHA1:
3
- metadata.gz: 937b657f00fc33f19a4a5b5bacd1c76c27f25746
4
- data.tar.gz: b5fbbe787c33fdeb8a40cefad62ca454f54d13a8
3
+ metadata.gz: 0b8b78b48157b5d06b0b0bd0acd50ebb366d8e47
4
+ data.tar.gz: 01121a252416e4d57b23da700657c3282cf69904
5
5
  SHA512:
6
- metadata.gz: 0a8c2e731f7b725d182a7540293f8188a54d5d551c1ca5945da0d0ed7b83754865e8b8ba88d88a09430ed13e6016c0a547a07089165690ff4b8bf55238b2c1fa
7
- data.tar.gz: 19ff82defe380b521039b295c13bfc2c76a9c04ffd05b3954980a589542a69eb3259a226a766770cde0c3048231650603bcec55bf2e760f01a6ec33efa8743b1
6
+ metadata.gz: cc7ddce6d4efcabe265120454474ca1d26127bb09cc4c5c291199b8d38880d392a5fdb111194913f8e10d25e1fb533813d6383578c045ae4ca300a221a6fbe92
7
+ data.tar.gz: 15d570a1ccc39b129975c98087b52de59e81a622d785354b6b8c085577c46f1bfa7e8e1165ce3dfc99498d5863ae60d420284af0967286af564a7e702f12ed46
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -39,7 +39,7 @@ Install:
39
39
 
40
40
  Bundler:
41
41
 
42
- gem "sixarm_ruby_xid", ">=3.1.0", "<4"
42
+ gem "sixarm_ruby_xid", ">=3.3.0", "<4"
43
43
 
44
44
  Require:
45
45
 
@@ -63,9 +63,10 @@ To install with high security:
63
63
 
64
64
  Methods:
65
65
 
66
- * `XID.new`: create an XID string initialized to a random string.
67
- * `XID.new(s): create an XID initialized to the given string.
66
+ * `XID.new`: create an XID and initialize to a random string.
67
+ * `XID.new(s): create an XID and initialize to a given string.
68
68
  * `XID#digest`: return a SHA256 digest as a 64-character string.
69
+ * `XID.digest(s)`: return a SHA256 digest as a 64-character string.
69
70
 
70
71
  Notes:
71
72
 
@@ -122,6 +123,8 @@ Some databases have specialize fields for 128 bit values, such as PostgreSQL and
122
123
 
123
124
  ## Changes
124
125
 
126
+ * 2015-02-12 3.3.0 Add XID.digest(s)
127
+ * 2015-02-12 3.2.0 Add XID.new(s) to initialize with a given string.
125
128
  * 2015-02-12 3.1.0 Add #digest.
126
129
  * 2015-02-11 3.0.0 Upgrade to XID.
127
130
  * 2013-08-20 2.1.0 Add #next to enable using this as an enumeration.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.3.0
@@ -16,4 +16,8 @@ class XID < String
16
16
  Digest::SHA256.new.update(self).to_s
17
17
  end
18
18
 
19
+ def self.digest(s)
20
+ Digest::SHA256.new.update(s).to_s
21
+ end
22
+
19
23
  end
@@ -47,4 +47,12 @@ describe XID do
47
47
 
48
48
  end
49
49
 
50
+ describe ".digest" do
51
+
52
+ it "digests" do
53
+ XID.digest("foo").must_match /\A[0-9a-f]{64}\z/
54
+ end
55
+
56
+ end
57
+
50
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixarm_ruby_xid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SixArm
metadata.gz.sig CHANGED
Binary file