STRING::CRC32 1g 2024-04-16 laplante@plcb.ca GOWEB/STRING — Compute CRC32 of a String


title: “EXCEPTION::FUNC_CALL Function” date: 2024-04-16 author: “laplante@plcb.ca” version: “1.0.0” section: “1g”

module: “GOWEB/STRING”

Name

string::crc32 Compute CRC32 of a String

Synopsis

string::crc32(string [, error: variable, return_int: bool, string...])

Aliases: crc32


Description

The crc32 function calculates the CRC32 checksum for a given string and returns the result.
By default, the return value is a hexadecimal string. If the return_int parameter is set to true, the function returns the checksum as an integer.


Parameters


Examples

res={{ 
    crc32("Hello, CRC32!"); "\n";
    crc32(""); "\n";
    crc32("ééèè"); "\n";
    crc32("ééèè"); "\n";
    crc32("Hello, CRC32!", "ééèè"); "\n";
    crc32("The quick brown fox jumped over the lazy dog."); "\n";
    crc32(return_int: true, "The quick brown fox jumped over the lazy dog."); "\n";
    y := crc32(return_int: true, "ééèè"); y; "\n";
    printf("%!x(MISSING)", y); "\n";
}};

Returns:

res = EE2AF3F1
00000000
223A7A9A
223A7A9A
["EE2AF3F1", "223A7A9A"]
82A34642
2191738434
574257818
223a7a9a

Author


See Also


Version History