rex-text 0.2.10 → 0.2.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82577f6bdcfff85e1625586209a36571f64d6318
4
- data.tar.gz: 223dd6bbdcd884582489e2153dfa7a77c29f4e3e
3
+ metadata.gz: 8849750ccde97e100a88b0eb765bfd064cc695be
4
+ data.tar.gz: 4b0e04c8bbb6fd428e24f640f477b8f4c5b68c81
5
5
  SHA512:
6
- metadata.gz: 5f9d58e80da6343554bdd7a369c48a04f9961c5c9b4286685cfdf349a453f4baf150e60ca18dc2066814a9f0e8bf15555b13a5a478326f6685436b7891653fa8
7
- data.tar.gz: 8d0eb4c2d869cadb35e0724b55a27efa31b95660bb8f5faa42474a23b5c907be234958f63066a459568df89b2771045050be7743dd2fc6462a8c9b0a7a4f613f
6
+ metadata.gz: fdb6ff6f05b44414fdb15c0d6ecc8624af322f3f116ce27baa89935bfe68bfa26448d2f1dc15569cc197d83d15f44657f042bd526b47dafe8d4785c45b80e8b8
7
+ data.tar.gz: 0bb8053e1d26cc63bfeb4ef9379303f770c93d615fc903c411b3e6fc6ea543b0d5e1e4cf32716c594cad6f5e0b187f6b114f72ecf6dd2f0fb005651fa7e8350c
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -12,7 +12,7 @@ module Rex
12
12
  #
13
13
  # @param data [String] The string to check for bad characters
14
14
  # @param badchars [String] A list of characters considered to be bad
15
- # @return [Fixnum] Index of the first bad character if any exist in +data+
15
+ # @return [Integer] Index of the first bad character if any exist in +data+
16
16
  # @return [nil] If +data+ contains no bad characters
17
17
  def self.badchar_index(data, badchars = '')
18
18
  badchars.unpack("C*").each { |badchar|
@@ -73,8 +73,8 @@ module Rex
73
73
  #
74
74
  # Rotate a 32-bit value to the right by +cnt+ bits
75
75
  #
76
- # @param val [Fixnum] The value to rotate
77
- # @param cnt [Fixnum] Number of bits to rotate by
76
+ # @param val [Integer] The value to rotate
77
+ # @param cnt [Integer] Number of bits to rotate by
78
78
  def self.ror(val, cnt)
79
79
  bits = [val].pack("N").unpack("B32")[0].split(//)
80
80
  1.upto(cnt) do |c|
@@ -23,7 +23,7 @@ module Rex
23
23
  #
24
24
  # Calculate the ROR13 hash of a given string
25
25
  #
26
- # @return [Fixnum]
26
+ # @return [Integer]
27
27
  def self.ror13_hash(name)
28
28
  hash = 0
29
29
  name.unpack("C*").each {|c| hash = ror(hash, 13); hash += c }
@@ -7,31 +7,31 @@ module Rex
7
7
  # without hanging the underlying calls that we historically rely upon.
8
8
 
9
9
  # @param str [String] Data to checksum
10
- # @return [Fixnum] 8-bit checksum
10
+ # @return [Integer] 8-bit checksum
11
11
  def self.checksum8(str)
12
12
  (str.unpack("C*").inject(:+) || 0) % 0x100
13
13
  end
14
14
 
15
15
  # @param str [String] Little-endian data to checksum
16
- # @return [Fixnum] 16-bit checksum
16
+ # @return [Integer] 16-bit checksum
17
17
  def self.checksum16_le(str)
18
18
  (str.unpack("v*").inject(:+) || 0) % 0x10000
19
19
  end
20
20
 
21
21
  # @param str [String] Big-endian data to checksum
22
- # @return [Fixnum] 16-bit checksum
22
+ # @return [Integer] 16-bit checksum
23
23
  def self.checksum16_be(str)
24
24
  (str.unpack("n*").inject(:+) || 0) % 0x10000
25
25
  end
26
26
 
27
27
  # @param str [String] Little-endian data to checksum
28
- # @return [Fixnum] 32-bit checksum
28
+ # @return [Integer] 32-bit checksum
29
29
  def self.checksum32_le(str)
30
30
  (str.unpack("V*").inject(:+) || 0) % 0x100000000
31
31
  end
32
32
 
33
33
  # @param str [String] Big-endian data to checksum
34
- # @return [Fixnum] 32-bit checksum
34
+ # @return [Integer] 32-bit checksum
35
35
  def self.checksum32_be(str)
36
36
  (str.unpack("N*").inject(:+) || 0) % 0x100000000
37
37
  end
@@ -38,7 +38,7 @@ module Rex
38
38
  # Compresses a string using zlib
39
39
  #
40
40
  # @param str [String] The string to be compressed
41
- # @param level [Fixnum] One of the Zlib compression level constants
41
+ # @param level [Integer] One of the Zlib compression level constants
42
42
  # @return [String] The compressed version of +str+
43
43
  def self.zlib_deflate(str, level = Zlib::BEST_COMPRESSION)
44
44
  if self.zlib_present?
@@ -72,7 +72,7 @@ module Rex
72
72
  # Compresses a string using gzip
73
73
  #
74
74
  # @param str (see zlib_deflate)
75
- # @param level [Fixnum] Compression level, 1 (fast) to 9 (best)
75
+ # @param level [Integer] Compression level, 1 (fast) to 9 (best)
76
76
  # @return (see zlib_deflate)
77
77
  def self.gzip(str, level = 9)
78
78
  raise RuntimeError, "Gzip support is not present." if (!zlib_present?)
data/lib/rex/text/hex.rb CHANGED
@@ -13,7 +13,7 @@ module Rex
13
13
  #
14
14
  # @param str (see to_octal)
15
15
  # @param prefix (see to_octal)
16
- # @param count [Fixnum] Number of bytes to put in each escape chunk
16
+ # @param count [Integer] Number of bytes to put in each escape chunk
17
17
  # @return [String] The escaped hex version of +str+
18
18
  def self.to_hex(str, prefix = "\\x", count = 1)
19
19
  raise ::RuntimeError, "unable to chunk into #{count} byte chunks" if ((str.length % count) > 0)
@@ -49,8 +49,8 @@ module Rex
49
49
  # Converts a string to a nicely formatted hex dump
50
50
  #
51
51
  # @param str [String] The string to convert
52
- # @param width [Fixnum] Number of bytes to convert before adding a newline
53
- # @param base [Fixnum] The base address of the dump
52
+ # @param width [Integer] Number of bytes to convert before adding a newline
53
+ # @param base [Integer] The base address of the dump
54
54
  def self.to_hex_dump(str, width=16, base=nil)
55
55
  buf = ''
56
56
  idx = 0
@@ -12,7 +12,7 @@ module Rex
12
12
  # supplied number of identifiable characters (slots). The supplied sets
13
13
  # should not contain any duplicate characters or the logic will fail.
14
14
  #
15
- # @param length [Fixnum]
15
+ # @param length [Integer]
16
16
  # @param sets [Array<(String,String,String)>] The character sets to choose
17
17
  # from. Should have 3 elements, each of which must be a string containing
18
18
  # no characters contained in the other sets.
@@ -66,14 +66,14 @@ module Rex
66
66
  #
67
67
  # @param pattern [String] The pattern to search. Usually the return value
68
68
  # from {.pattern_create}
69
- # @param value [String,Fixnum,Bignum]
70
- # @return [Fixnum] Index of the given +value+ within +pattern+, if it exists
69
+ # @param value [String,Integer]
70
+ # @return [Integer] Index of the given +value+ within +pattern+, if it exists
71
71
  # @return [nil] if +pattern+ does not contain +value+
72
72
  # @see pattern_create
73
73
  def self.pattern_offset(pattern, value, start=0)
74
- if (value.kind_of?(String))
74
+ if value.kind_of?(String)
75
75
  pattern.index(value, start)
76
- elsif (value.kind_of?(Fixnum) or value.kind_of?(Bignum))
76
+ elsif value.kind_of?(Integer)
77
77
  pattern.index([ value ].pack('V'), start)
78
78
  else
79
79
  raise ::ArgumentError, "Invalid class for value: #{value.class}"
@@ -20,7 +20,7 @@ module Rex
20
20
  # || ||
21
21
  #
22
22
  # @param text [String] The string to cowsay
23
- # @param width [Fixnum] Width of the cow's cloud. Default's to cowsay(1)'s default, 39.
23
+ # @param width [Integer] Width of the cow's cloud. Default's to cowsay(1)'s default, 39.
24
24
  def self.cowsay(text, width=39)
25
25
  # cowsay(1) chunks a message up into 39-byte chunks and wraps it in '| ' and ' |'
26
26
  # Rex::Text.wordwrap(text, 0, 39, ' |', '| ') almost does this, but won't
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.10"
3
+ VERSION = "0.2.11"
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.10
4
+ version: 0.2.11
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-12-28 00:00:00.000000000 Z
91
+ date: 2017-01-18 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
metadata.gz.sig CHANGED
Binary file