@CRC32

<< Click to Display Table of Contents >>

Navigation:  TCC > Variables & Functions > Functions >

@CRC32

String mode:        @CRC32[s,string[,start[,length]]]

File mode:        @CRC32[[d,][f,]filename[,start[,length]]]

Binary mode:        @CRC32[[b,]handle[,start[,length]]]

 

Returns the CRC32 value (using the same algorithm as PKZIP or WINZIP) of the characters in string, the contents of the file filename, or the contents of the binary buffer. If the first parameter is s for a string, any leading or trailing whitespace characters in string are included. If the first argument is a b, the filename argument should be the handle returned by @BALLOC.

 

If the first argument for file mode is a d, @CRC32 will return the result in decimal (base 10) format. (This is the same format as POSIX 1003.2.) Otherwise, the result is returned in hexadecimal format.

 

Filename may be specified with or without an optional f. @CRC32 returns -1 if the file does not exist, or it cannot be read.

 

Since Take Command handles all internal strings as Unicode, @CRC32 will return different results for a string and the identical string in an ASCII file.

 

See also: @SHA256, @SHA384, @SHA512, and @MD5..

 

Examples:

 

echo %@crc32["C:\windows\explorer.exe"]

3F1E7CFE

 

echo %@crc32["%comspec"]

F36EB74C

 

echo %@crc32[d,"%comspec"]

4084119372