ronin-support 1.1.0.rc1 → 1.1.0.rc2
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
- data/ChangeLog.md +9 -0
- data/lib/ronin/support/encoding/js.rb +15 -9
- data/lib/ronin/support/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f9c07db8f174e4bc785b712a7bb3066173df5a07d819c29d79c2364a477a5c3
|
4
|
+
data.tar.gz: ab14f01da2f4e2f7446637046e4336b26bd19baf16a1d204a17766cb73f88304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b10488e76b74059cc26d9f0285bc5e0c04c1cae012b334e03be2513e6c0699037370e41c3180634982769bd21762852c31415090df0bc3b3a92c438243a9a73
|
7
|
+
data.tar.gz: 818e99b86658c23348005ca7b1b8487138312cb23750d6aff1f91d2f622c4d2b37d0b8b49629cd96da3652e4fe716501b60d3d92a6a4e7bdec8da63be723ee1d
|
data/ChangeLog.md
CHANGED
@@ -109,6 +109,15 @@
|
|
109
109
|
{Ronin::Support::Network::HTTP}, and
|
110
110
|
{Ronin::Support::Network::HTTP::Mixin} methods.
|
111
111
|
|
112
|
+
### 1.0.7 / 2024-07-13
|
113
|
+
|
114
|
+
* Improved the performance of {Ronin::Support::Encoding::JS.unescape} and
|
115
|
+
{String#js_unescape} by 2x.
|
116
|
+
* Correctly parse Unicode surrogate character pairs in JavaScript
|
117
|
+
strings (ex: `"\uD83D\uDE80"`) in {Ronin::Support::Encoding::JS.unescape},
|
118
|
+
{String#js_unescape}, {Ronin::Support::Encoding::JS.unquote}, and
|
119
|
+
{String#js_unquote}.
|
120
|
+
|
112
121
|
### 1.0.6 / 2024-06-19
|
113
122
|
|
114
123
|
* Fixed error messages in {Ronin::Support::Encoding::Base64.encode} and
|
@@ -183,16 +183,22 @@ module Ronin
|
|
183
183
|
#
|
184
184
|
def self.unescape(data)
|
185
185
|
unescaped = String.new(encoding: Encoding::UTF_8)
|
186
|
+
scanner = StringScanner.new(data)
|
186
187
|
|
187
|
-
|
188
|
-
unescaped <<
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
188
|
+
until scanner.eos?
|
189
|
+
unescaped << if (backslash_escape = scanner.scan(/\\[btnfr'"\\]/))
|
190
|
+
BACKSLASHED_CHARS[backslash_escape]
|
191
|
+
elsif (surrogate_pair = scanner.scan(/\\u[dD][890abAB][0-9a-fA-F]{2}\\u[dD][cdefCDEF][0-9a-fA-F]{2}/))
|
192
|
+
hi = surrogate_pair[2..6].to_i(16)
|
193
|
+
lo = surrogate_pair[8..12].to_i(16)
|
194
|
+
|
195
|
+
(0x1_0000 + ((hi - 0xd800) * 0x400) + (lo - 0xdc00))
|
196
|
+
elsif (unicode_escape = scanner.scan(/[\\%]u[0-9a-fA-F]{1,4}/))
|
197
|
+
unicode_escape[2..].to_i(16)
|
198
|
+
elsif (hex_escape = scanner.scan(/[\\%][0-9a-fA-F]{1,2}/))
|
199
|
+
hex_escape[1..].to_i(16)
|
200
|
+
else
|
201
|
+
scanner.getch
|
196
202
|
end
|
197
203
|
end
|
198
204
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chars
|