mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 07:21:02 -04:00
char() operation now supports multiple values inside bracket. i.e. CHAR(45,120,49,45,81,45)
This commit is contained in:
parent
1e60054fe3
commit
93d47630b8
1 changed files with 15 additions and 12 deletions
|
@ -81,13 +81,16 @@ const ByteRepr = {
|
||||||
* @returns {byteArray}
|
* @returns {byteArray}
|
||||||
*/
|
*/
|
||||||
runFromCharHex: function(input, args) {
|
runFromCharHex: function(input, args) {
|
||||||
var data = input.replace(/cha?r\((\d{1,3})\)/ig,
|
var re = /cha?r\((((\d{1,3})(,\s?)?)+)\)/ig;
|
||||||
function(match, p1) {
|
var inner_re = /(\d{1,3}),?/g;
|
||||||
if (p1) {
|
var match, inner_match;
|
||||||
return Utils.byteArrayToChars([parseInt(p1)]);
|
var result = "";
|
||||||
};
|
while ((match = re.exec(input)) != null) {
|
||||||
});
|
while ((inner_match = inner_re.exec(match[1])) != null) {
|
||||||
return data;
|
result += Utils.byteArrayToChars([parseInt(inner_match[1])]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return input.replace(re, result);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue