konstruo 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.
Files changed (126) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +22 -0
  4. data/.tool-versions +1 -0
  5. data/CHANGELOG.md +21 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +35 -0
  8. data/Rakefile +10 -0
  9. data/lib/konstruo/mapper.rb +120 -0
  10. data/lib/konstruo/version.rb +6 -0
  11. data/lib/konstruo.rb +18 -0
  12. data/sorbet/config +4 -0
  13. data/sorbet/rbi/annotations/.gitattributes +1 -0
  14. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  15. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  16. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  17. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  18. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  19. data/sorbet/rbi/annotations/activerecord.rbi +92 -0
  20. data/sorbet/rbi/annotations/activesupport.rbi +454 -0
  21. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  22. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  23. data/sorbet/rbi/annotations/railties.rbi +61 -0
  24. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  25. data/sorbet/rbi/dsl/.gitattributes +1 -0
  26. data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
  27. data/sorbet/rbi/gems/.gitattributes +1 -0
  28. data/sorbet/rbi/gems/actioncable@7.2.1.rbi +3096 -0
  29. data/sorbet/rbi/gems/actionmailbox@7.2.1.rbi +1832 -0
  30. data/sorbet/rbi/gems/actionmailer@7.2.1.rbi +2664 -0
  31. data/sorbet/rbi/gems/actionpack@7.2.1.rbi +20536 -0
  32. data/sorbet/rbi/gems/actiontext@7.2.1.rbi +1697 -0
  33. data/sorbet/rbi/gems/actionview@7.2.1.rbi +15752 -0
  34. data/sorbet/rbi/gems/activejob@7.2.1.rbi +2828 -0
  35. data/sorbet/rbi/gems/activemodel@7.2.1.rbi +6762 -0
  36. data/sorbet/rbi/gems/activerecord@7.2.1.rbi +41433 -0
  37. data/sorbet/rbi/gems/activestorage@7.2.1.rbi +3247 -0
  38. data/sorbet/rbi/gems/activesupport@7.2.1.rbi +21142 -0
  39. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  40. data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
  41. data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +78 -0
  42. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  43. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
  44. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  45. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  46. data/sorbet/rbi/gems/dashbrains-rubocop-config@1.0.4.rbi +9 -0
  47. data/sorbet/rbi/gems/date@3.3.4.rbi +75 -0
  48. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
  49. data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
  50. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  51. data/sorbet/rbi/gems/globalid@1.2.1.rbi +749 -0
  52. data/sorbet/rbi/gems/i18n@1.14.5.rbi +2359 -0
  53. data/sorbet/rbi/gems/io-console@0.7.2.rbi +9 -0
  54. data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
  55. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  56. data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
  57. data/sorbet/rbi/gems/loofah@2.22.0.rbi +1081 -0
  58. data/sorbet/rbi/gems/mail@2.8.1.rbi +8658 -0
  59. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  60. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  61. data/sorbet/rbi/gems/minitest@5.25.1.rbi +1546 -0
  62. data/sorbet/rbi/gems/net-imap@0.4.16.rbi +10845 -0
  63. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  64. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  65. data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +1228 -0
  66. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  67. data/sorbet/rbi/gems/nio4r@2.7.3.rbi +293 -0
  68. data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
  69. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  70. data/sorbet/rbi/gems/parser@3.3.5.0.rbi +5519 -0
  71. data/sorbet/rbi/gems/prism@1.0.0.rbi +35493 -0
  72. data/sorbet/rbi/gems/psych@5.1.2.rbi +1769 -0
  73. data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
  74. data/sorbet/rbi/gems/rack-session@2.0.0.rbi +727 -0
  75. data/sorbet/rbi/gems/rack-test@2.1.0.rbi +747 -0
  76. data/sorbet/rbi/gems/rack@3.1.7.rbi +4902 -0
  77. data/sorbet/rbi/gems/rackup@2.1.0.rbi +390 -0
  78. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +758 -0
  79. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +785 -0
  80. data/sorbet/rbi/gems/rails@7.2.1.rbi +9 -0
  81. data/sorbet/rbi/gems/railties@7.2.1.rbi +3824 -0
  82. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  83. data/sorbet/rbi/gems/rake@13.2.1.rbi +3046 -0
  84. data/sorbet/rbi/gems/rbi@0.2.0.rbi +4105 -0
  85. data/sorbet/rbi/gems/rdoc@6.7.0.rbi +12721 -0
  86. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
  87. data/sorbet/rbi/gems/reline@0.5.10.rbi +9 -0
  88. data/sorbet/rbi/gems/rspec-core@3.13.1.rbi +11012 -0
  89. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
  90. data/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi +5341 -0
  91. data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +1630 -0
  92. data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
  93. data/sorbet/rbi/gems/rubocop-ast@1.32.3.rbi +7446 -0
  94. data/sorbet/rbi/gems/rubocop-capybara@2.21.0.rbi +9 -0
  95. data/sorbet/rbi/gems/rubocop-factory_bot@2.26.1.rbi +9 -0
  96. data/sorbet/rbi/gems/rubocop-graphql@1.5.4.rbi +9 -0
  97. data/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi +9 -0
  98. data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +9 -0
  99. data/sorbet/rbi/gems/rubocop-rails@2.26.1.rbi +9 -0
  100. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  101. data/sorbet/rbi/gems/rubocop-rspec@3.0.5.rbi +9 -0
  102. data/sorbet/rbi/gems/rubocop-rspec_rails@2.30.0.rbi +9 -0
  103. data/sorbet/rbi/gems/rubocop-sorbet@0.8.5.rbi +9 -0
  104. data/sorbet/rbi/gems/rubocop@1.66.1.rbi +58268 -0
  105. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  106. data/sorbet/rbi/gems/securerandom@0.3.1.rbi +396 -0
  107. data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
  108. data/sorbet/rbi/gems/stringio@3.1.1.rbi +9 -0
  109. data/sorbet/rbi/gems/tapioca@0.16.2.rbi +3581 -0
  110. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  111. data/sorbet/rbi/gems/timeout@0.4.1.rbi +149 -0
  112. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  113. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  114. data/sorbet/rbi/gems/useragent@0.16.10.rbi +9 -0
  115. data/sorbet/rbi/gems/webrick@1.8.1.rbi +2607 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +993 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +121 -0
  118. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  119. data/sorbet/rbi/gems/yard@0.9.37.rbi +18570 -0
  120. data/sorbet/rbi/gems/zeitwerk@2.6.18.rbi +1051 -0
  121. data/sorbet/rbi/todo.rbi +6 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +9 -0
  124. data/tasks/bundle_update.rake +14 -0
  125. data/tasks/sorbet.rake +26 -0
  126. metadata +216 -0
@@ -0,0 +1,396 @@
1
+ # typed: false
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `securerandom` gem.
5
+ # Please instead update this file by running `bin/tapioca gem securerandom`.
6
+
7
+
8
+ class Random::Base
9
+ include ::Random::Formatter
10
+ extend ::Random::Formatter
11
+
12
+ def initialize(*_arg0); end
13
+
14
+ def bytes(_arg0); end
15
+ def rand(*_arg0); end
16
+ def seed; end
17
+ end
18
+
19
+ # == \Random number formatter.
20
+ #
21
+ # Formats generated random numbers in many manners. When <tt>'random/formatter'</tt>
22
+ # is required, several methods are added to empty core module <tt>Random::Formatter</tt>,
23
+ # making them available as Random's instance and module methods.
24
+ #
25
+ # Standard library SecureRandom is also extended with the module, and the methods
26
+ # described below are available as a module methods in it.
27
+ #
28
+ # === Examples
29
+ #
30
+ # Generate random hexadecimal strings:
31
+ #
32
+ # require 'random/formatter'
33
+ #
34
+ # prng = Random.new
35
+ # prng.hex(10) #=> "52750b30ffbc7de3b362"
36
+ # prng.hex(10) #=> "92b15d6c8dc4beb5f559"
37
+ # prng.hex(13) #=> "39b290146bea6ce975c37cfc23"
38
+ # # or just
39
+ # Random.hex #=> "1aed0c631e41be7f77365415541052ee"
40
+ #
41
+ # Generate random base64 strings:
42
+ #
43
+ # prng.base64(10) #=> "EcmTPZwWRAozdA=="
44
+ # prng.base64(10) #=> "KO1nIU+p9DKxGg=="
45
+ # prng.base64(12) #=> "7kJSM/MzBJI+75j8"
46
+ # Random.base64(4) #=> "bsQ3fQ=="
47
+ #
48
+ # Generate random binary strings:
49
+ #
50
+ # prng.random_bytes(10) #=> "\016\t{\370g\310pbr\301"
51
+ # prng.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337"
52
+ # Random.random_bytes(6) #=> "\xA1\xE6Lr\xC43"
53
+ #
54
+ # Generate alphanumeric strings:
55
+ #
56
+ # prng.alphanumeric(10) #=> "S8baxMJnPl"
57
+ # prng.alphanumeric(10) #=> "aOxAg8BAJe"
58
+ # Random.alphanumeric #=> "TmP9OsJHJLtaZYhP"
59
+ #
60
+ # Generate UUIDs:
61
+ #
62
+ # prng.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
63
+ # prng.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
64
+ # Random.uuid #=> "f14e0271-de96-45cc-8911-8910292a42cd"
65
+ #
66
+ # All methods are available in the standard library SecureRandom, too:
67
+ #
68
+ # SecureRandom.hex #=> "05b45376a30c67238eb93b16499e50cf"
69
+ #
70
+ # source://securerandom//lib/random/formatter.rb#55
71
+ module Random::Formatter
72
+ # Generate a random alphanumeric string.
73
+ #
74
+ # The argument _n_ specifies the length, in characters, of the alphanumeric
75
+ # string to be generated.
76
+ # The argument _chars_ specifies the character list which the result is
77
+ # consist of.
78
+ #
79
+ # If _n_ is not specified or is nil, 16 is assumed.
80
+ # It may be larger in the future.
81
+ #
82
+ # The result may contain A-Z, a-z and 0-9, unless _chars_ is specified.
83
+ #
84
+ # require 'random/formatter'
85
+ #
86
+ # Random.alphanumeric #=> "2BuBuLf3WfSKyQbR"
87
+ # # or
88
+ # prng = Random.new
89
+ # prng.alphanumeric(10) #=> "i6K93NdqiH"
90
+ #
91
+ # Random.alphanumeric(4, chars: [*"0".."9"]) #=> "2952"
92
+ # # or
93
+ # prng = Random.new
94
+ # prng.alphanumeric(10, chars: [*"!".."/"]) #=> ",.,++%/''."
95
+ #
96
+ # source://securerandom//lib/random/formatter.rb#369
97
+ def alphanumeric(n = T.unsafe(nil), chars: T.unsafe(nil)); end
98
+
99
+ # Generate a random base64 string.
100
+ #
101
+ # The argument _n_ specifies the length, in bytes, of the random number
102
+ # to be generated. The length of the result string is about 4/3 of _n_.
103
+ #
104
+ # If _n_ is not specified or is nil, 16 is assumed.
105
+ # It may be larger in the future.
106
+ #
107
+ # The result may contain A-Z, a-z, 0-9, "+", "/" and "=".
108
+ #
109
+ # require 'random/formatter'
110
+ #
111
+ # Random.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="
112
+ # # or
113
+ # prng = Random.new
114
+ # prng.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
115
+ #
116
+ # See RFC 3548 for the definition of base64.
117
+ #
118
+ # source://securerandom//lib/random/formatter.rb#115
119
+ def base64(n = T.unsafe(nil)); end
120
+
121
+ # Generate a random hexadecimal string.
122
+ #
123
+ # The argument _n_ specifies the length, in bytes, of the random number to be generated.
124
+ # The length of the resulting hexadecimal string is twice of _n_.
125
+ #
126
+ # If _n_ is not specified or is nil, 16 is assumed.
127
+ # It may be larger in the future.
128
+ #
129
+ # The result may contain 0-9 and a-f.
130
+ #
131
+ # require 'random/formatter'
132
+ #
133
+ # Random.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
134
+ # # or
135
+ # prng = Random.new
136
+ # prng.hex #=> "91dc3bfb4de5b11d029d376634589b61"
137
+ #
138
+ # source://securerandom//lib/random/formatter.rb#93
139
+ def hex(n = T.unsafe(nil)); end
140
+
141
+ # Generate a random binary string.
142
+ #
143
+ # The argument _n_ specifies the length of the result string.
144
+ #
145
+ # If _n_ is not specified or is nil, 16 is assumed.
146
+ # It may be larger in future.
147
+ #
148
+ # The result may contain any byte: "\x00" - "\xff".
149
+ #
150
+ # require 'random/formatter'
151
+ #
152
+ # Random.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
153
+ # # or
154
+ # prng = Random.new
155
+ # prng.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"
156
+ #
157
+ # source://securerandom//lib/random/formatter.rb#72
158
+ def random_bytes(n = T.unsafe(nil)); end
159
+
160
+ # Generate a random URL-safe base64 string.
161
+ #
162
+ # The argument _n_ specifies the length, in bytes, of the random number
163
+ # to be generated. The length of the result string is about 4/3 of _n_.
164
+ #
165
+ # If _n_ is not specified or is nil, 16 is assumed.
166
+ # It may be larger in the future.
167
+ #
168
+ # The boolean argument _padding_ specifies the padding.
169
+ # If it is false or nil, padding is not generated.
170
+ # Otherwise padding is generated.
171
+ # By default, padding is not generated because "=" may be used as a URL delimiter.
172
+ #
173
+ # The result may contain A-Z, a-z, 0-9, "-" and "_".
174
+ # "=" is also used if _padding_ is true.
175
+ #
176
+ # require 'random/formatter'
177
+ #
178
+ # Random.urlsafe_base64 #=> "b4GOKm4pOYU_-BOXcrUGDg"
179
+ # # or
180
+ # prng = Random.new
181
+ # prng.urlsafe_base64 #=> "UZLdOkzop70Ddx-IJR0ABg"
182
+ #
183
+ # prng.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
184
+ # prng.urlsafe_base64(nil, true) #=> "-M8rLhr7JEpJlqFGUMmOxg=="
185
+ #
186
+ # See RFC 3548 for the definition of URL-safe base64.
187
+ #
188
+ # source://securerandom//lib/random/formatter.rb#146
189
+ def urlsafe_base64(n = T.unsafe(nil), padding = T.unsafe(nil)); end
190
+
191
+ # Generate a random v4 UUID (Universally Unique IDentifier).
192
+ #
193
+ # require 'random/formatter'
194
+ #
195
+ # Random.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
196
+ # Random.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
197
+ # # or
198
+ # prng = Random.new
199
+ # prng.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
200
+ #
201
+ # The version 4 UUID is purely random (except the version).
202
+ # It doesn't contain meaningful information such as MAC addresses, timestamps, etc.
203
+ #
204
+ # The result contains 122 random bits (15.25 random bytes).
205
+ #
206
+ # See RFC4122[https://datatracker.ietf.org/doc/html/rfc4122] for details of UUID.
207
+ #
208
+ # source://securerandom//lib/random/formatter.rb#170
209
+ def uuid; end
210
+
211
+ # Generate a random v4 UUID (Universally Unique IDentifier).
212
+ #
213
+ # require 'random/formatter'
214
+ #
215
+ # Random.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
216
+ # Random.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
217
+ # # or
218
+ # prng = Random.new
219
+ # prng.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
220
+ #
221
+ # The version 4 UUID is purely random (except the version).
222
+ # It doesn't contain meaningful information such as MAC addresses, timestamps, etc.
223
+ #
224
+ # The result contains 122 random bits (15.25 random bytes).
225
+ #
226
+ # See RFC4122[https://datatracker.ietf.org/doc/html/rfc4122] for details of UUID.
227
+ #
228
+ # source://securerandom//lib/random/formatter.rb#170
229
+ def uuid_v4; end
230
+
231
+ # Generate a random v7 UUID (Universally Unique IDentifier).
232
+ #
233
+ # require 'random/formatter'
234
+ #
235
+ # Random.uuid_v7 # => "0188d4c3-1311-7f96-85c7-242a7aa58f1e"
236
+ # Random.uuid_v7 # => "0188d4c3-16fe-744f-86af-38fa04c62bb5"
237
+ # Random.uuid_v7 # => "0188d4c3-1af8-764f-b049-c204ce0afa23"
238
+ # Random.uuid_v7 # => "0188d4c3-1e74-7085-b14f-ef6415dc6f31"
239
+ # # |<--sorted-->| |<----- random ---->|
240
+ #
241
+ # # or
242
+ # prng = Random.new
243
+ # prng.uuid_v7 # => "0188ca51-5e72-7950-a11d-def7ff977c98"
244
+ #
245
+ # The version 7 UUID starts with the least significant 48 bits of a 64 bit
246
+ # Unix timestamp (milliseconds since the epoch) and fills the remaining bits
247
+ # with random data, excluding the version and variant bits.
248
+ #
249
+ # This allows version 7 UUIDs to be sorted by creation time. Time ordered
250
+ # UUIDs can be used for better database index locality of newly inserted
251
+ # records, which may have a significant performance benefit compared to random
252
+ # data inserts.
253
+ #
254
+ # The result contains 74 random bits (9.25 random bytes).
255
+ #
256
+ # Note that this method cannot be made reproducable because its output
257
+ # includes not only random bits but also timestamp.
258
+ #
259
+ # See draft-ietf-uuidrev-rfc4122bis[https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/]
260
+ # for details of UUIDv7.
261
+ #
262
+ # ==== Monotonicity
263
+ #
264
+ # UUIDv7 has millisecond precision by default, so multiple UUIDs created
265
+ # within the same millisecond are not issued in monotonically increasing
266
+ # order. To create UUIDs that are time-ordered with sub-millisecond
267
+ # precision, up to 12 bits of additional timestamp may added with
268
+ # +extra_timestamp_bits+. The extra timestamp precision comes at the expense
269
+ # of random bits. Setting <tt>extra_timestamp_bits: 12</tt> provides ~244ns
270
+ # of precision, but only 62 random bits (7.75 random bytes).
271
+ #
272
+ # prng = Random.new
273
+ # Array.new(4) { prng.uuid_v7(extra_timestamp_bits: 12) }
274
+ # # =>
275
+ # ["0188d4c7-13da-74f9-8b53-22a786ffdd5a",
276
+ # "0188d4c7-13da-753b-83a5-7fb9b2afaeea",
277
+ # "0188d4c7-13da-754a-88ea-ac0baeedd8db",
278
+ # "0188d4c7-13da-7557-83e1-7cad9cda0d8d"]
279
+ # # |<--- sorted --->| |<-- random --->|
280
+ #
281
+ # Array.new(4) { prng.uuid_v7(extra_timestamp_bits: 8) }
282
+ # # =>
283
+ # ["0188d4c7-3333-7a95-850a-de6edb858f7e",
284
+ # "0188d4c7-3333-7ae8-842e-bc3a8b7d0cf9", # <- out of order
285
+ # "0188d4c7-3333-7ae2-995a-9f135dc44ead", # <- out of order
286
+ # "0188d4c7-3333-7af9-87c3-8f612edac82e"]
287
+ # # |<--- sorted -->||<---- random --->|
288
+ #
289
+ # Any rollbacks of the system clock will break monotonicity. UUIDv7 is based
290
+ # on UTC, which excludes leap seconds and can rollback the clock. To avoid
291
+ # this, the system clock can synchronize with an NTP server configured to use
292
+ # a "leap smear" approach. NTP or PTP will also be needed to synchronize
293
+ # across distributed nodes.
294
+ #
295
+ # Counters and other mechanisms for stronger guarantees of monotonicity are
296
+ # not implemented. Applications with stricter requirements should follow
297
+ # {Section 6.2}[https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-07.html#monotonicity_counters]
298
+ # of the specification.
299
+ #
300
+ # source://securerandom//lib/random/formatter.rb#248
301
+ def uuid_v7(extra_timestamp_bits: T.unsafe(nil)); end
302
+
303
+ private
304
+
305
+ # Generate a string that randomly draws from a
306
+ # source array of characters.
307
+ #
308
+ # The argument _source_ specifies the array of characters from which
309
+ # to generate the string.
310
+ # The argument _n_ specifies the length, in characters, of the string to be
311
+ # generated.
312
+ #
313
+ # The result may contain whatever characters are in the source array.
314
+ #
315
+ # require 'random/formatter'
316
+ #
317
+ # prng.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron"
318
+ # prng.choose([*'0'..'9'], 5) #=> "27309"
319
+ #
320
+ # source://securerandom//lib/random/formatter.rb#314
321
+ def choose(source, n); end
322
+
323
+ # Internal interface to Random; Generate random data _n_ bytes.
324
+ #
325
+ # source://securerandom//lib/random/formatter.rb#296
326
+ def gen_random(n); end
327
+ end
328
+
329
+ # == Secure random number generator interface.
330
+ #
331
+ # This library is an interface to secure random number generators which are
332
+ # suitable for generating session keys in HTTP cookies, etc.
333
+ #
334
+ # You can use this library in your application by requiring it:
335
+ #
336
+ # require 'securerandom'
337
+ #
338
+ # It supports the following secure random number generators:
339
+ #
340
+ # * openssl
341
+ # * /dev/urandom
342
+ # * Win32
343
+ #
344
+ # SecureRandom is extended by the Random::Formatter module which
345
+ # defines the following methods:
346
+ #
347
+ # * alphanumeric
348
+ # * base64
349
+ # * choose
350
+ # * gen_random
351
+ # * hex
352
+ # * rand
353
+ # * random_bytes
354
+ # * random_number
355
+ # * urlsafe_base64
356
+ # * uuid
357
+ #
358
+ # These methods are usable as class methods of SecureRandom such as
359
+ # +SecureRandom.hex+.
360
+ #
361
+ # If a secure random number generator is not available,
362
+ # +NotImplementedError+ is raised.
363
+ #
364
+ # source://securerandom//lib/securerandom.rb#41
365
+ module SecureRandom
366
+ extend ::Random::Formatter
367
+
368
+ class << self
369
+ # Returns a random binary string containing +size+ bytes.
370
+ #
371
+ # See Random.bytes
372
+ #
373
+ # source://securerandom//lib/securerandom.rb#50
374
+ def bytes(n); end
375
+
376
+ # source://securerandom//lib/securerandom.rb#64
377
+ def gen_random(n); end
378
+
379
+ private
380
+
381
+ # Implementation using OpenSSL
382
+ #
383
+ # source://securerandom//lib/securerandom.rb#59
384
+ def gen_random_openssl(n); end
385
+
386
+ # Implementation using system random device
387
+ #
388
+ # source://securerandom//lib/securerandom.rb#64
389
+ def gen_random_urandom(n); end
390
+ end
391
+ end
392
+
393
+ # The version
394
+ #
395
+ # source://securerandom//lib/securerandom.rb#44
396
+ SecureRandom::VERSION = T.let(T.unsafe(nil), String)