securerandom-int64 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4326399672c1cd728f18bd8503b344d14cbdac08
4
+ data.tar.gz: 7dc716d2f67cecfb7527ef27bfec901a1d474ce1
5
+ SHA512:
6
+ metadata.gz: 3e790fe431a381505a2768a8aa549b64c16f5c07a571002103fa6e4ef8abbd436b4f7f596f07e9dc94f637e175a90e19114d2ac8ce5b58fd81be80f3cbf08ebb
7
+ data.tar.gz: d3c536125b0ad3a43ed9000cb7027b3ecf5d4217ce08f19e76194e424e8fb1d330111172c48db76f18c6a368aa551a3c439490d550a2ae92157694b69323f48e
@@ -0,0 +1,11 @@
1
+ # Version History
2
+
3
+ ### 1.0.0 / 2017-03-15
4
+
5
+ Generate secure 64-bit integers using the same approach used by UUIDs.
6
+
7
+ ```ruby
8
+ require "securerandom/int64"
9
+
10
+ i = SecureRandom.int64
11
+ ```
@@ -0,0 +1,5 @@
1
+ History.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ lib/securerandom/int64.rb
@@ -0,0 +1,34 @@
1
+ # securerandom-int64
2
+
3
+ Easy generation of random 64-bit integers.
4
+
5
+ ```ruby
6
+ require "securerandom/int64"
7
+
8
+ i = SecureRandom.int64
9
+ ```
10
+
11
+ ## LICENSE:
12
+
13
+ (The MIT License)
14
+
15
+ Copyright (c) 2017 Mike Moore
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining
18
+ a copy of this software and associated documentation files (the
19
+ 'Software'), to deal in the Software without restriction, including
20
+ without limitation the rights to use, copy, modify, merge, publish,
21
+ distribute, sublicense, and/or sell copies of the Software, and to
22
+ permit persons to whom the Software is furnished to do so, subject to
23
+ the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be
26
+ included in all copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
29
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
31
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
32
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
33
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
34
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require "rubygems"
4
+ require "hoe"
5
+
6
+ Hoe.plugin :git
7
+ Hoe.plugin :minitest
8
+
9
+ Hoe.spec "securerandom-int64" do
10
+ developer "Mike Moore", "mike@blowmage.com"
11
+
12
+ self.summary = "Easy generation of random 64-bit integers."
13
+ self.description = "Generate secure 64-bit integers using the same approach used by UUIDs."
14
+ self.urls = ["http://blowmage.com/securerandom-int64"]
15
+
16
+ self.history_file = "History.md"
17
+ self.readme_file = "README.md"
18
+ self.testlib = :minitest
19
+
20
+ license "MIT"
21
+ end
22
+
23
+ # vim: syntax=ruby
@@ -0,0 +1,17 @@
1
+ require "securerandom"
2
+
3
+ module Random::Formatter
4
+ # SecureRandom.int64 generates a random signed 64-bit integer.
5
+ #
6
+ # The result will be an integer between the values -9,223,372,036,854,775,808
7
+ # and 9,223,372,036,854,775,807.
8
+ def int64
9
+ random_bytes(8).unpack("q")[0]
10
+ end
11
+ end
12
+
13
+ module SecureRandom
14
+ module Int64
15
+ VERSION = "1.0.0"
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: securerandom-int64
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Mike Moore
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hoe
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.16'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.16'
55
+ description: Generate secure 64-bit integers using the same approach used by UUIDs.
56
+ email:
57
+ - mike@blowmage.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files:
61
+ - History.md
62
+ - Manifest.txt
63
+ - README.md
64
+ files:
65
+ - History.md
66
+ - Manifest.txt
67
+ - README.md
68
+ - Rakefile
69
+ - lib/securerandom/int64.rb
70
+ homepage: http://blowmage.com/securerandom-int64
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options:
76
+ - "--main"
77
+ - README.md
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.6.8
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Easy generation of random 64-bit integers.
96
+ test_files: []