ctf-party 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ctf_party/hex.rb +20 -0
- data/lib/ctf_party/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1bc032bfe7236e135eccd26e75a67d6b178b2486b1610741017d61e6cd78c16
|
4
|
+
data.tar.gz: 40ec92a25213dc22154190cf2e726ad87ce693e9f2e283c7b544c1e378634869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d2fb3942843aafde1c157ec4ee598cdfdb9970a178f66fb291964d3f5e867838c94683068ab4a8e6bc02318e3e56336f3832315f7e0a8e01581649354cd7840
|
7
|
+
data.tar.gz: 91709a253527bec78f79cb45c5bf0611f09262dc0c25beacb0a153c534f4f4042e18977a3c020f961c7786551017a056b423114f72ee2ba7a794c09d8f5378ed
|
data/lib/ctf_party/hex.rb
CHANGED
@@ -90,6 +90,11 @@ class String
|
|
90
90
|
return opts[:prefix] + out
|
91
91
|
end
|
92
92
|
|
93
|
+
# Alias for {String#to_hex}.
|
94
|
+
def str2hex(opts = {})
|
95
|
+
to_hex(opts)
|
96
|
+
end
|
97
|
+
|
93
98
|
# Encode a string into hexadecimal in place as described
|
94
99
|
# for {String#to_hex}.
|
95
100
|
# @example
|
@@ -100,6 +105,11 @@ class String
|
|
100
105
|
replace(to_hex(opts))
|
101
106
|
end
|
102
107
|
|
108
|
+
# Alias for {String#to_hex!}.
|
109
|
+
def str2hex!(opts = {})
|
110
|
+
to_hex!(opts)
|
111
|
+
end
|
112
|
+
|
103
113
|
# Decode a hexadecimal string
|
104
114
|
# @param opts [Hash] optional parameters
|
105
115
|
# @option opts [String] :prefix Prefix of the input. Default value is a void
|
@@ -123,6 +133,11 @@ class String
|
|
123
133
|
raise ArgumentError ':nibble expects :high or :low'
|
124
134
|
end
|
125
135
|
|
136
|
+
# Alias for {String#from_hex}.
|
137
|
+
def hex2str(opts = {})
|
138
|
+
from_hex(opts)
|
139
|
+
end
|
140
|
+
|
126
141
|
# Decode a hexadecimal string in place as described
|
127
142
|
# for {String#from_hex}.
|
128
143
|
# @example
|
@@ -133,6 +148,11 @@ class String
|
|
133
148
|
replace(from_hex(opts))
|
134
149
|
end
|
135
150
|
|
151
|
+
# Alias for {String#from_hex!}.
|
152
|
+
def hex2str!(opts = {})
|
153
|
+
from_hex!(opts)
|
154
|
+
end
|
155
|
+
|
136
156
|
# Encode an hexadecimal string to a binary string
|
137
157
|
# @param opts [Hash] optional parameters
|
138
158
|
# @option opts [String] :prefix Prefix of the input. Default value is a void
|
data/lib/ctf_party/version.rb
CHANGED