ESM: Added Zlib ops and created a Zlib library.

This commit is contained in:
n1474335 2018-04-02 20:46:55 +01:00
parent fbb3a02315
commit 083d2d1cc4
16 changed files with 913 additions and 350 deletions

View file

@ -238,22 +238,22 @@ const Categories = [
// "Extract EXIF",
// ]
// },
// {
// name: "Compression",
// ops: [
// "Raw Deflate",
// "Raw Inflate",
// "Zlib Deflate",
// "Zlib Inflate",
// "Gzip",
// "Gunzip",
// "Zip",
// "Unzip",
{
name: "Compression",
ops: [
"Raw Deflate",
"Raw Inflate",
"Zlib Deflate",
"Zlib Inflate",
"Gzip",
"Gunzip",
"Zip",
"Unzip",
// "Bzip2 Decompress",
// "Tar",
// "Untar",
// ]
// },
]
},
// {
// name: "Hashing",
// ops: [

View file

@ -114,6 +114,102 @@
}
]
},
"Gunzip": {
"module": "Compression",
"description": "Decompresses data which has been compressed using the deflate algorithm with gzip headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": []
},
"Gzip": {
"module": "Compression",
"description": "Compresses data using the deflate algorithm with gzip headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Compression type",
"type": "option",
"value": [
"Dynamic Huffman Coding",
"Fixed Huffman Coding",
"None (Store)"
]
},
{
"name": "Filename (optional)",
"type": "string",
"value": ""
},
{
"name": "Comment (optional)",
"type": "string",
"value": ""
},
{
"name": "Include file checksum",
"type": "boolean",
"value": false
}
]
},
"Raw Deflate": {
"module": "Compression",
"description": "Compresses data using the deflate algorithm with no headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Compression type",
"type": "option",
"value": [
"Dynamic Huffman Coding",
"Fixed Huffman Coding",
"None (Store)"
]
}
]
},
"Raw Inflate": {
"module": "Compression",
"description": "Decompresses data which has been compressed using the deflate algorithm with no headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Start index",
"type": "number",
"value": 0
},
{
"name": "Initial output buffer size",
"type": "number",
"value": 0
},
{
"name": "Buffer expansion type",
"type": "option",
"value": [
"Adaptive",
"Block"
]
},
{
"name": "Resize buffer after decompression",
"type": "boolean",
"value": false
},
{
"name": "Verify result",
"type": "boolean",
"value": false
}
]
},
"Show Base64 offsets": {
"module": "Default",
"description": "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.<br><br>This operation shows all possible offsets for a given string so that each possible encoding can be considered.",
@ -237,5 +333,129 @@
]
}
]
},
"Unzip": {
"module": "Compression",
"description": "Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Password",
"type": "binaryString",
"value": ""
},
{
"name": "Verify result",
"type": "boolean",
"value": false
}
]
},
"Zip": {
"module": "Compression",
"description": "Compresses data using the PKZIP algorithm with the given filename.<br><br>No support for multiple files at this time.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Filename",
"type": "string",
"value": "file.txt"
},
{
"name": "Comment",
"type": "string",
"value": ""
},
{
"name": "Password",
"type": "binaryString",
"value": ""
},
{
"name": "Compression method",
"type": "option",
"value": [
"Deflate",
"None (Store)"
]
},
{
"name": "Operating system",
"type": "option",
"value": [
"MSDOS",
"Unix",
"Macintosh"
]
},
{
"name": "Compression type",
"type": "option",
"value": [
"Dynamic Huffman Coding",
"Fixed Huffman Coding",
"None (Store)"
]
}
]
},
"Zlib Deflate": {
"module": "Compression",
"description": "Compresses data using the deflate algorithm adding zlib headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Compression type",
"type": "option",
"value": [
"Dynamic Huffman Coding",
"Fixed Huffman Coding",
"None (Store)"
]
}
]
},
"Zlib Inflate": {
"module": "Compression",
"description": "Decompresses data which has been compressed using the deflate algorithm with zlib headers.",
"inputType": "byteArray",
"outputType": "byteArray",
"flowControl": false,
"args": [
{
"name": "Start index",
"type": "number",
"value": 0
},
{
"name": "Initial output buffer size",
"type": "number",
"value": 0
},
{
"name": "Buffer expansion type",
"type": "option",
"value": [
"Adaptive",
"Block"
]
},
{
"name": "Resize buffer after decompression",
"type": "boolean",
"value": false
},
{
"name": "Verify result",
"type": "boolean",
"value": false
}
]
}
}

View file

@ -0,0 +1,30 @@
/**
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import Gunzip from "../../operations/Gunzip";
import Gzip from "../../operations/Gzip";
import RawDeflate from "../../operations/RawDeflate";
import RawInflate from "../../operations/RawInflate";
import Unzip from "../../operations/Unzip";
import Zip from "../../operations/Zip";
import ZlibDeflate from "../../operations/ZlibDeflate";
import ZlibInflate from "../../operations/ZlibInflate";
const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Compression = {
"Gunzip": Gunzip,
"Gzip": Gzip,
"Raw Deflate": RawDeflate,
"Raw Inflate": RawInflate,
"Unzip": Unzip,
"Zip": Zip,
"Zlib Deflate": ZlibDeflate,
"Zlib Inflate": ZlibInflate,
};
export default OpModules;

View file

@ -8,12 +8,14 @@
* @license Apache-2.0
*/
import DefaultModule from "./Default";
import CompressionModule from "./Compression";
const OpModules = {};
Object.assign(
OpModules,
DefaultModule,
CompressionModule,
);
export default OpModules;