TCC-RT > Variables & Functions > Functions > @MD5

@MD5

<< Click to Display Table of Contents >>

Navigation:  TCC-RT > Variables & Functions > Functions >

@MD5

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

File mode:        @MD5[[f,]filename[,start[,length]]]

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

 

Returns the 32 hexadecimal digit MD5 hash 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.

 

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

If the first parameter is b for a binary buffer, handle is the handle returned by @BALLOC.

 

The optional start parameter specifies the starting position in the binary buffer or file (in bytes, defaulting to 0).

 

The optional length parameter specifies the length of the buffer to hash (in bytes, defaulting to 0).

 

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

 

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

 

Example:

 

echo %@md5[s,this is a string]

93D64091ADF43E8FC0B74257AFD82FC3