- Jul
- 20
- 1
There seems to be a problem with the builtin functions for SHA256, SHA384 and SHA512 running against filenames with embedded spaces. While the MD5 and SHA1 functions seem to work fine, SHA256 and SHA512 always return -1 and SHA384 doesn't even seem to exist as a function regardless of input. I tested using an explicit first parameter (not "s") to make sure that it is being treated as a filename and I also tested using both quoted and unquoted filenames. I created the following simple .btm file named "test file.btm" to demonstrate the problem:
[d:\dev]cat "test sha.btm"
[d:\dev]cat "test sha.btm"
ver
echo Testing ^%@md5["test sha.btm"]
echo %@md5["test sha.btm"]
echo Testing ^%@sha1["test sha.btm"]
echo %@sha1["test sha.btm"]
echo Testing ^%@sha256["test sha.btm"]
echo %@sha256["test sha.btm"]
echo Testing ^%@sha512["test sha.btm"]
echo %@sha512["test sha.btm"]
echo Testing ^%@sha384["test sha.btm"]
echo %@sha384["test sha.btm"]
and running the file I get the following output:echo Testing ^%@md5["test sha.btm"]
echo %@md5["test sha.btm"]
echo Testing ^%@sha1["test sha.btm"]
echo %@sha1["test sha.btm"]
echo Testing ^%@sha256["test sha.btm"]
echo %@sha256["test sha.btm"]
echo Testing ^%@sha512["test sha.btm"]
echo %@sha512["test sha.btm"]
echo Testing ^%@sha384["test sha.btm"]
echo %@sha384["test sha.btm"]
TCC 19.00.30 x64 Windows 10 [Version 6.3.10586]
Testing %@md5["test sha.btm"]
5743589F6AD60686194EAED077CE64E6
Testing %@sha1["test sha.btm"]
AE5323A88E967B21256B53DF8CF8CA52EDFD5F7F
Testing %@sha256["test sha.btm"]
-1
Testing %@sha512["test sha.btm"]
-1
Testing %@sha384["test sha.btm"]
TCC: (Sys) D:\dev\test sha.btm [11] Incorrect function.
"%@sha384["test sha.btm"]"
Testing %@md5["test sha.btm"]
5743589F6AD60686194EAED077CE64E6
Testing %@sha1["test sha.btm"]
AE5323A88E967B21256B53DF8CF8CA52EDFD5F7F
Testing %@sha256["test sha.btm"]
-1
Testing %@sha512["test sha.btm"]
-1
Testing %@sha384["test sha.btm"]
TCC: (Sys) D:\dev\test sha.btm [11] Incorrect function.
"%@sha384["test sha.btm"]"