UNPKG

middleout.js

Version:

A spoof compression library that pretends to revolutionize data compression using made-up algorithms — inspired by the legendary middle-out compression from Silicon Valley

24 lines (21 loc) 1.06 kB
import { MiddleOutConfig, CompressionResult } from '../../types/index.js'; /** * Compresses a string using the fake Tokenized Noise Truncation (TNT) algorithm. * This spoofed technique replaces every third character with `*` and adds fake entropy tokens. * * @param input - The original string to compress. * @param config - `Optional` Compression configuration object. * - `targetWeissman` - Optional spoofed target Weissman Score. * @returns A `CompressionResult` containing all compression details. */ declare function compressWithTNT(input: string, config?: Partial<MiddleOutConfig>): CompressionResult; /** * Decompresses a TNT-encoded string. * Since TNT compression is lossy and fake, this just removes noise and replaces `*` with `?`. * * @param encoded - A spoofed encoded string in the format: * `MO::tnt:<compressed_data>::WEISSMAN::<score>` * @returns A "decompressed" version with noise removed and placeholders. */ declare function decompressWithTNT(encoded: string): string; export { compressWithTNT, decompressWithTNT };