STRING::CRC32
1g 2024-04-16 laplante@plcb.ca GOWEB/STRING — Compute CRC32 of a Stringtitle: “EXCEPTION::FUNC_CALL Function” date: 2024-04-16 author: “laplante@plcb.ca” version: “1.0.0” section: “1g”
string::crc32 Compute CRC32 of a String
string::crc32(string [, error: variable, return_int: bool, string...])
Aliases: crc32
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.
string
The string or strings for which the CRC32 checksum will be computed.
error (optional)
A variable to capture any error information.
return_int (optional, boolean)
If set to true
, the function returns the CRC32 checksum as an integer instead of a hexadecimal string.
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