CLASS :: LZS Archive
Compress or Decompress a LZS archive
This is very slow with large strings ... extremely slow !!!
This is why the max (hardcoded) length of the string it can compress/decompress is 4096 bytes
The purpose of this class is to compress/decompress cookies that can be shared also with PHP
The PHP version of this class is available in modules/mod-js-components/libs/ArchLzs.php
LZS Archiver for JavaScript :: compress on-the-fly a string using only Javascript with the LZS algorithm
Language: Javascript
Located at: lib/js/framework/smart-framework.pak.js; arch_utils.js
Package: modules.Javascript:Archivers
Class Name: ArchLzs
Frozen: No
Version: 20210526
Usage: ArchLzs.method();
Depends: smartJ$Utils, smartJ$CryptoHash
class Methods
public staticfunctioncompressToBase64 (
{String}input
) {} . {String}
@return: {String} The compressed string LZS + Base64
@param: {String} input The original string to be compressed
Compress a string to LZS + Base64
public staticfunctiondecompressFromBase64 (
{String}input
) {} . {String}
@return: {String} The uncompressed (original) string
@param: {String} input The LZS + Base64 compressed string
Decompress from Base64 + LZS
class Properties
class Constants
Sample code: JavaScript
var plainStr = 'Some String';
var archivedStr = ArchLzs.compressToBase64(plainStr);
var unArchivedStr = ArchLzs.decompressFromBase64(archivedStr);
if(plainStr !== unArchivedStr) {
alert('Javascript LZS Archiver Failed: Plain String is different after Archive/Unarchive operations !');
}
console.log(plainStr, archivedStr, unArchivedStr);
documentation generated on: 2023-10-19 23:19:06 +0000
Compress or Decompress a LZS archive
This is very slow with large strings ... extremely slow !!!
This is why the max (hardcoded) length of the string it can compress/decompress is 4096 bytes
The purpose of this class is to compress/decompress cookies that can be shared also with PHP
The PHP version of this class is available in modules/mod-js-components/libs/ArchLzs.php
LZS Archiver for JavaScript :: compress on-the-fly a string using only Javascript with the LZS algorithm