This commit is contained in:
sanex3339
2016-06-01 01:05:47 +03:00
parent bdb3bf5013
commit af30d82001
4 changed files with 12 additions and 2 deletions
+4
View File
@@ -42,7 +42,11 @@ class Utils {
}
static stringToUnicode(string) {
const radix = 16, unicodeSliceValue = -4;
let regexp = new RegExp('[a-zA-Z]');
return `'${string.replace(/[\s\S]/g, (escape) => {
if (regexp.test(escape)) {
return '\\x' + escape.charCodeAt(0).toString(radix);
}
return `\\u${('0000' + escape.charCodeAt(0).toString(radix)).slice(unicodeSliceValue)}`;
})}'`;
}
+1 -1
View File
@@ -35,7 +35,7 @@ let obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
console.log('inside', abc.item);
}
console.log('between', abc);
console.log('тест', abc);
var abc = {};
+6
View File
@@ -100,7 +100,13 @@ export class Utils {
const radix: number = 16,
unicodeSliceValue: number = -4;
let regexp: RegExp = new RegExp('[a-zA-Z]');
return `'${string.replace(/[\s\S]/g, (escape: string): string => {
if (regexp.test(escape)) {
return '\\x' + escape.charCodeAt(0).toString(radix);
}
return `\\u${('0000' + escape.charCodeAt(0).toString(radix)).slice(unicodeSliceValue)}`;
})}'`;
}
+1 -1
View File
@@ -36,7 +36,7 @@ let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
console.log('inside', abc.item);
}
console.log('between', abc);
console.log('тест', abc);
var abc = {};