Class: ArchLzs - 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 Javascript
The Javascript version of this class is available in modules/mod-js-components/views/js/arch-lzs/arch-lzs.js
Language: PHP
Located at: modules/mod-js-components/libs/ArchLzs.php
Usage: static object: Class::method() - This class provides only STATIC methods
class Methods
public staticfunctioncompressToBase64 (
STRING$input
) {} :: STRING
@return: {STRING} The Base64 LZS Compressed String
@param: {STRING} $input: The uncompressed string
Compress a string to LZS + Base64
public staticfunctiondecompressFromBase64 (
STRING$input
) {} :: STRING
@return: {STRING} The uncompressed string
@param: {STRING} $input: The Base64 LZS Compressed String
Decompress a Base64 + LZS compressed string
class Properties
class Constants
Sample code: PHP
<?php
// Usage example:
$myString = 'Some string to archive as LZS';
$archString = \SmartModExtLib\JsComponents\ArchLzs::compressToBase64($myString); // archive the string
$unarchString = \SmartModExtLib\JsComponents\ArchLzs::decompressFromBase64($archString); // unarchive it back
if((string)$unarchString !== (string)$myString) { // Test: check if unarchive is the same as archive
@http_response_code(500);
die('LZS Archive test Failed !');
} //end if
// #end php code
documentation generated on: 2024-12-16 17:13:21 +0000
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 Javascript
The Javascript version of this class is available in modules/mod-js-components/views/js/arch-lzs/arch-lzs.js