Skip to content

[Improvement] String array function improvement #726

@da411d

Description

@da411d

Currently 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions