[Improvement] String array function improvement
See original GitHub issueCurrently there is only one function, using which we get string from string array. With manged identifiers enabled it usually has name b
.
Here is the simplest example:
var a = [
'log',
'foo',
'bar',
'baz'
];
var b = function (c, d) {
c = c - 0x0;
var e = a[c];
return e;
};
console[b('0x0')](b('0x1'), b('0x2'), b('0x3'));
I think it will be more interesting if you add more same functions and use random of them:
var a = [
'log',
'foo',
'bar',
'baz'
];
var b = function (c, d) {
c = c - 0x0;
var e = a[c];
return e;
};
var c = function (c, d) { // Just define same function
c = c - 0x0;
var e = a[c];
return e;
};
var d = b; // Make link to function
var e = function (c, d) { // Just define same function
return b(c, d);
};
console[c('0x0')](b('0x1'), e('0x2'), d('0x3')); // And use random of them
Then you even can encode different strings with different algorithms - some of them just base64
, some - rc4
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:69 (69 by maintainers)
Top Results From Across the Web
Code improvement, array of Strings - java - Stack Overflow
Can you give me some tips on how to improve my code? The problem was: Given an array of strings, return a new...
Read more >10 Best Javascript Performance Tips For 2022 - Ksolves
In 2022, here are ten of the best tips for improving Javascript performance. Using String Replace Function. String.replace() is a built-in ...
Read more >Understanding C++ String Array | DigitalOcean
The string keyword allocates memory to the elements of the array at dynamic or run-time accordingly. Thus it saves the headache of static...
Read more >Improving Arrays in Hack - HHVM
When an array is passed to or returned from a function, the programmer has the guarantee that it will not be modified unless...
Read more >`array` type improvements · Issue #9122 · php/php-src - GitHub
Here I suggest five features which can greatly improve typing array s and throw away the need of most related docblocks.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The question is - should I enable
stringArrayWrappersCount
by default? Need to compare performance with/without this option. If the runtime performance is the same - maybe I’ll enablestringArrayWrappersCount
by default with a value1
or2
The best thing is that all main logic is described inside
StringArrayTransformer
class. https://github.com/javascript-obfuscator/javascript-obfuscator/blob/string-array-intermediate-calls-wrapper/src/node-transformers/string-array-transformers/StringArrayTransformer.ts