A script I wrote which contains functions to compress or obfuscate code.
List of functions:
ObcompFolderTo(); - Copies, obfuscates, and compresses one folder to another.
ObcompFileTo(); - Copies, obfuscates, and compresses one file to another.
ObcompCode(); - Returns an obfuscated and compressed copy of the code.
CompressFolderTo(); - Copies and compresses one folder to another.
CompressFileTo(); - Copies and compresses one file to another.
CompressCode(); - Returns a compressed copy of the code.
ObfuscateFolderTo(); - Copies and obfuscates one folder to another.
ObfuscateFileTo(); - Copies and obfuscates one file to another.
ObfuscateCode(); - Returns an obfuscated copy of the code.
Script_Compressor.zipI also need some help testing it for issues. The specific criteria it needs to meet are as follows.
- Valid code must always be turned into valid, equivalent, code.
- Invalid code must never be turned into valid code.
- For valid code, the following properties must hold true:
- The output of the main three functions1 must always be the same length or shorter than its input. strLen(%code) >= strLen(CompressCode(%code))
- If fed their own output, the main three functions must produce the same result. CompressCode(%code) $= CompressCode(CompressCode(%code))
- The CompressCode(); function must remove all whitespace which is not necessary for the code to remain valid.
1CompressCode();, ObfuscateCode();, and ObcompCode();.
If you find any code which fails one of the above criteria, please post the criterion, the functions which fail, the original code, and output code.
Also, if you have any suggestions for additional criteria, please post them.