rex-text 0.2.5 → 0.2.6

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: 0c27818e326723cec7411336af1822d729eda34b
4
- data.tar.gz: b1a0bec23fb35bdee52502b8b943fcbe0234820e
3
+ metadata.gz: 6804328eb04ea3968cde6cb6925419c507597379
4
+ data.tar.gz: 636467558171c4f26c52376aa14eac886d2c63ac
5
5
  SHA512:
6
- metadata.gz: 4097f2e94c8efd357f8ca2773fe57066f547d600167809be138e26ee3dd81dd4720e8d01dda0b0513b0154cd7601e793d4a6f187f3e6391cab5b36217f78c313
7
- data.tar.gz: fa1442a7548c6dcceb1c69d30696d4e6b8c9fc4a2cf7ec6876cc6690b60d3071d4bdc5c2d09de88629e3b824bcc96de41a33e466e5ff53a472cd4956e1249c73
6
+ metadata.gz: 2dcce21ae8540abf5a495a6cd01d7b16f7e43d1298d8163cd3482c33a470d1246b57e9591a25df51967307102180eebf5b4e87c7d2e922bb7654f7a2e9178e4d
7
+ data.tar.gz: 2c189bb292dfa58f2729b8bed4904ba398b68466062e2bbfda2d5872a8f1842a3b64e50c80a85f7bfc213b46ef875897f61651d8522e2b7d3cd171688d38559f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rex/text.rb CHANGED
@@ -140,7 +140,7 @@ module Rex
140
140
  def self.converge_sets(sets, idx, offsets, length) # :nodoc:
141
141
  buf = sets[idx][offsets[idx]].chr
142
142
 
143
- # If there are more sets after use, converage with them.
143
+ # If there are more sets after use, converge with them.
144
144
  if (sets[idx + 1])
145
145
  buf << converge_sets(sets, idx + 1, offsets, length)
146
146
  else
@@ -33,14 +33,7 @@ module Rex
33
33
  sets.length.times { offsets << 0 }
34
34
 
35
35
  until buf.length >= length
36
- begin
37
36
  buf << converge_sets(sets, 0, offsets, length)
38
- end
39
- end
40
-
41
- # Maximum permutations reached, but we need more data
42
- if (buf.length < length)
43
- buf = buf * (length / buf.length.to_f).ceil
44
37
  end
45
38
 
46
39
  buf[0,length]
@@ -274,3 +274,27 @@ module Rex
274
274
 
275
275
  end
276
276
  end
277
+
278
+ # from http://dzone.com/snippets/convert-unicode-codepoints-utf
279
+
280
+ # This module lazily defines constants of the form Uxxxx for all Unicode
281
+ # codepoints from U0000 to U10FFFF. The value of each constant is the
282
+ # UTF-8 string for the codepoint.
283
+ # Examples:
284
+ # copyright = Unicode::U00A9
285
+ # euro = Unicode::U20AC
286
+ # infinity = Unicode::U221E
287
+ #
288
+ module ::Unicode
289
+ def self.const_missing(name)
290
+ # Check that the constant name is of the right form: U0000 to U10FFFF
291
+ if name.to_s =~ /^U([0-9a-fA-F]{4,5}|10[0-9a-fA-F]{4})$/
292
+ # Convert the codepoint to an immutable UTF-8 string,
293
+ # define a real constant for that value and return the value
294
+ #p name, name.class
295
+ const_set(name, [$1.to_i(16)].pack("U").freeze)
296
+ else # Raise an error for constants that are not Unicode.
297
+ raise NameError, "Uninitialized constant: Unicode::#{name}"
298
+ end
299
+ end
300
+ end
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David 'thelightcosine' Maloney
@@ -88,7 +88,7 @@ cert_chain:
88
88
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
89
89
  8mVuTXnyJOKRJA==
90
90
  -----END CERTIFICATE-----
91
- date: 2016-11-14 00:00:00.000000000 Z
91
+ date: 2016-11-21 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
metadata.gz.sig CHANGED
Binary file