mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
27 lines
808 B
TypeScript
27 lines
808 B
TypeScript
'use strict';
|
|
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
|
|
|
|
(function () {
|
|
const JavaScriptObfuscator: any = require('../../index');
|
|
|
|
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
|
`
|
|
// Paste your JavaScript code here
|
|
function hi() {
|
|
console.log("Hello World!");
|
|
}
|
|
hi();
|
|
`,
|
|
{
|
|
compact: false,
|
|
renameGlobals: true,
|
|
identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
|
|
stringArray: true,
|
|
rotateStringArray: false
|
|
}
|
|
).getObfuscatedCode();
|
|
|
|
console.log(obfuscatedCode);
|
|
console.log(eval(obfuscatedCode));
|
|
})();
|