Please enable JavaScript to view this site.

Take Command / TCC Help v. 28

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

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

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

 

Returns the SHA-256 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 %@sha256[c:\windows\notepad.exe]

142E1D688EF0568370C37187FD9F2351D7DDEDA574F8BFA9B0FA4EF42DB85AA2

 

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