2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-05 23:53:27 +00:00

Merge pull request #1545 from starplanet/master

Fixed ToDecimal signed logic
This commit is contained in:
jg42526
2025-07-23 11:25:15 +01:00
committed by GitHub

View File

@@ -45,11 +45,12 @@ class ToDecimal extends Operation {
* @returns {string}
*/
run(input, args) {
input = new Uint8Array(input);
const delim = Utils.charRep(args[0]),
signed = args[1];
if (signed) {
input = input.map(v => v > 0x7F ? v - 0xFF - 1 : v);
input = new Int8Array(input);
} else {
input = new Uint8Array(input);
}
return input.join(delim);
}