rex-text 0.2.5 → 0.2.6
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rex/text.rb +1 -1
- data/lib/rex/text/pattern.rb +0 -7
- data/lib/rex/text/unicode.rb +24 -0
- data/lib/rex/text/version.rb +1 -1
- metadata +2 -2
- 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: 6804328eb04ea3968cde6cb6925419c507597379
|
4
|
+
data.tar.gz: 636467558171c4f26c52376aa14eac886d2c63ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
data/lib/rex/text/pattern.rb
CHANGED
@@ -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]
|
data/lib/rex/text/unicode.rb
CHANGED
@@ -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
|
data/lib/rex/text/version.rb
CHANGED
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.
|
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-
|
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
|