String mode:        @SHA1[s[a|8],string[,start[,length]]]

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

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

 

Returns the SHA1 checksum 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 Unicode UTF16 string, sa for an ASCII string, or s8 for a UTF8 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.

 

The first parameter determines whether the output is in upper or lower case:

 

s or f or blower case
S or F or Bupper case

 

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).

 

Example:

 

echo %@sha1[c:\windows\notepad.exe]

7EB0139D2175739B3CCB0D1110067820BE6ABD29

 

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