rex-text 0.2.40 → 0.2.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rex/text/lang.rb +22 -0
- data/lib/rex/text/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99760857150edd0c9d0c3147b6529fa51244895878cf8aabb265cc17054931ed
|
4
|
+
data.tar.gz: 0bf2431de8fbdd5618a65925972e09e768f1e5b3c960a63cd4764d4bbc1252e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10dc8566dc93c40022a13b03cb0f2e4ebde49e1bba0a7133d7048512635be71a084e54c4e68e39a7b3b36f44da57a81db6896c9cd739b314b49133cce4d9bcb3
|
7
|
+
data.tar.gz: 92daf4cf40ba727164f354be16b7193b0c84dc2bf87f89f4dd59ea2d6ac1172ac58993ad12dc30216a9e490d24f1c8aaad7083d75f01033f461fe0628cd0c6c8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rex/text/lang.rb
CHANGED
@@ -38,6 +38,28 @@ module Rex
|
|
38
38
|
ret << " };\n"
|
39
39
|
end
|
40
40
|
|
41
|
+
#
|
42
|
+
# Converts to a golang style array of bytes
|
43
|
+
#
|
44
|
+
def self.to_golang(str, wrap = DefaultWrap, name = "buf")
|
45
|
+
ret = "#{name} := []byte{"
|
46
|
+
i = -1;
|
47
|
+
while (i += 1) < str.length
|
48
|
+
ret << "\n" if i%(wrap/4) == 0
|
49
|
+
ret << "0x" << str[i].unpack("H*")[0] << ", "
|
50
|
+
end
|
51
|
+
ret = ret[0..ret.length-3] #cut off last comma
|
52
|
+
ret << " }\n"
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Creates a golang style comment
|
58
|
+
#
|
59
|
+
def self.to_golang_comment(str, wrap = DefaultWrap)
|
60
|
+
return "/*\n" + wordwrap(str, 0, wrap, '', '') + "*/\n"
|
61
|
+
end
|
62
|
+
|
41
63
|
#
|
42
64
|
# Creates a c-style comment
|
43
65
|
#
|
data/lib/rex/text/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|