Platforms to show: All Mac Windows Linux Cross-Platform
Adler32MemoryMBS(adler as integer, buf as memoryblock, offset as integer, length as integer) as integer
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The adler32 hash function from the zlib library.
Notes:
Offset and length must be correct for your memoryblock or you will crash your application!
Update a running Adler-32 checksum with the bytes and return the updated checksum. If buf is nil, this function returns the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The adler32 hash function from the zlib library.
Notes:
Offset and length must be correct for your memoryblock or you will crash your application!
Update a running Adler-32 checksum with the bytes and return the updated checksum. If buf is nil, this function returns the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster.
Adler32StringMBS(adler as integer, buf as string) as integer
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The adler32 hash function from the zlib library.
Example:
Notes:
Update a running Adler-32 checksum with the bytes and return the updated checksum. If buf is nil, this function returns the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The adler32 hash function from the zlib library.
Example:
dim b as binarystream // some stream
dim adler as integer
dim data as string
dim originalAdler as integer = 12345
adler=Adler32MemoryMBS(0,nil,0,0)
data=b.read(10000)
while data<>""
adler=Adler32StringMBS(adler, data)
data=b.read(10000)
wend
if adler <> originalAdler then msgbox "Error in checksum!"
Update a running Adler-32 checksum with the bytes and return the updated checksum. If buf is nil, this function returns the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster.
CompressZLibMBS(buf as string,level as integer) as string
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Compresses the data and returns it as string.
Example:
Notes: Compression level is going from 0 to 9, where 0 is no compression and 9 is best compression.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Compresses the data and returns it as string.
Example:
dim s as string = "Hello World"
s=CompressZLibMBS(s,9)
Some examples using this method:
CRC32MemoryMBS(crc as integer, buf as memoryblock, offset as integer, length as integer) as integer
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The crc32 hash function from the zlib library.
Notes:
Offset and length must be correct for your memoryblock or you will crash your application!
Update a running crc with the bytes and return the updated crc. If buf is nil, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The crc32 hash function from the zlib library.
Notes:
Offset and length must be correct for your memoryblock or you will crash your application!
Update a running crc with the bytes and return the updated crc. If buf is nil, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application.
CRC32StringMBS(crc as integer, buf as string) as integer
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The crc32 hash function from the zlib library.
Example:
Notes: Update a running crc with the bytes and return the updated crc. If buf is nil, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Plugin version: 5.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The crc32 hash function from the zlib library.
Example:
dim originalCrc as integer// original CRC
dim crc as integer // new crc
dim data as string
dim b as binarystream
crc=0
data=b.read(10000)
while data<>""
crc=CRC32StringMBS(crc, data)
data=b.read(10000)
wend
if crc <> originalCrc then msgbox "Error in checksum!"
Some examples using this method:
DecompressZLibMBS(buf as string,size as integer) as string
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decompresses the data and returns it as string.
Example:
Notes: As DecompressZLibMBS can't know the size of the decompressed data you should give it a hint. Best is to save the size of the decompressed data on compression. Else you must guess the size which can be 10 times the size of the compressed data.
global method, Compression, MBS REALbasic Compression Plugin (Zip), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Decompresses the data and returns it as string.
Example:
dim s as string = "Hello World"
s=CompressZLibMBS(s,9)
s=DecompressZLibMBS(s,10000)
MsgBox s
Some examples using this method:
The items on this page are in the following plugins: MBS REALbasic Compression Plugin.
Links
MBS Realbasic Plugins - Pfarrgemeinde St. Arnulf Nickenich