Garry's Mod Wiki

util.CRC

  string util.CRC( string stringToChecksum )

Description

Generates the CRC Checksum of the specified string.

This is NOT a hashing function. It is a checksum, typically used for error detection/data corruption detection. It is possible for this function to generate "collisions", where two different strings will produce the same CRC. If you need a hashing function, use util.SHA256.

Arguments

1 string stringToChecksum
The string to calculate the checksum of.

Returns

1 string
The unsigned 32 bit checksum.

Example

Prints out the CRC-32 checksum of "a".

print( util.CRC( "a" ))
Output: 3904355907