Gzip (String function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Template:String:Gzip subtitle}} | {{Template:String:Gzip subtitle}} | ||
This function compresses a longstring using the "deflate" algorithm, which is described completely in RFC 1951. The GZIP format is described in RFC 1952. It is very effective with HTML and XML data. | This function compresses a longstring using the "deflate" algorithm, which is described completely in RFC 1951. The GZIP format is described in RFC 1952. It is very effective with HTML and XML data. | ||
Line 41: | Line 40: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | |||
<li>The <var>[[NCMPBUF parameter|NCMPBUF]]</var> parameter must be set by User 0 before <var>Gzip</var> can be used. If <var>Gzip</var> is called and the <var>NCMPBUF</var> value is 0, the request is cancelled. | |||
</ul> | |||
==See also== | ==See also== |
Latest revision as of 21:19, 3 September 2015
Compress a longstring with GZIP (String class)
[Introduced in Sirius Mods 7.4]
This function compresses a longstring using the "deflate" algorithm, which is described completely in RFC 1951. The GZIP format is described in RFC 1952. It is very effective with HTML and XML data.
Syntax
%outString = string:Gzip[( [FixedCode= boolean], [LazyMatch= boolean], - [MaxChain= number], [Filename= string], - [LastModified= number])]
Syntax terms
%outString | The result of the GZIP operation, compressing the method object string. |
---|---|
string | The string to be compressed by the GZIP operation. |
FixedCode | FixedCode is an optional, name required, parameter that is a Boolean value that specifies whether the compression uses fixed codes or is dynamic, based on the contents of the input string.
|
LazyMatch | LazyMatch is an optional, name required, parameter that is a Boolean value that specifies whether to use "lazy match" compression, as specified in RFC 1951. The default value for this argument is False (do not use "lazy match" compression). |
MaxChain | MaxChain is an optional, name required, parameter that is a numeric value that specifies the maximum hash chain length, as explained in RFC 1951. The default value for this argument is 0. If specified, it must be between 0 and 99, inclusive. |
Filename | Filename is an optional, name required, parameter that is a string to be stored as the internal name of the compressed string. Decompression programs will use this name for the output file when the string is un-zipped. The maximum length of the file name is 32 bytes. |
LastModified | The date/time stamp to be stored as a component of %outString, expressed as the number of milliseconds since 12:00 AM, Jan 1, 1900. The default is the current date and time (that is, %(System):CurrentTimeMilliseconds).
After Gzip stores a value into %outString, the LastModified date/time stamp can be obtained with the GunzipDatetimeNS function, but note that its output is in seconds, not milliseconds. |
Usage notes
- The NCMPBUF parameter must be set by User 0 before Gzip can be used. If Gzip is called and the NCMPBUF value is 0, the request is cancelled.
See also
- The inverse of Gzip is Gunzip.
- Other related methods: