UNPKG

vanzy-protect

Version:

Epic Obfuscator Yeahhh

39 lines (38 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.numberObfLvl2 = void 0; const cfg_1 = require("../config/cfg"); const Randomizer_1 = require("../random/Randomizer"); function numberObfLvl2(num) { const U = (0, cfg_1.cfg)().transforms.noES2021Syntax ? '' : '_'; if (num === 0) { const numer = Randomizer_1.Randomizer.INSTANCE.rand(1, 9999999999); if (Randomizer_1.Randomizer.INSTANCE.rand(0, 10) % 2) { return numer.toString(10) + '-0x0' + U + numer.toString(16); } else { return '0x0' + U + numer.toString(16) + '-' + numer.toString(10); } } else if (num > 0) { const p1 = Randomizer_1.Randomizer.INSTANCE.rand(0, num); const p2 = num - p1; if (Randomizer_1.Randomizer.INSTANCE.rand(0, 10) % 2) { return p1.toString(10) + '+0x0' + U + p2.toString(16); } else { return '0x0' + U + p1.toString(16) + '+' + p2.toString(10); } } else { const p1 = Randomizer_1.Randomizer.INSTANCE.rand(num, 0); const p2 = num - p1; if (Randomizer_1.Randomizer.INSTANCE.rand(0, 10) % 2) { return p1.toString(10) + '-0x0' + U + Math.abs(p2).toString(16); } else { return '-0x0' + U + Math.abs(p1).toString(16) + '+' + p2.toString(10); } } } exports.numberObfLvl2 = numberObfLvl2;