I am trying to generate sha256 hash of a string in a batch script.
For this purpose I found sha256sum.exe (link)
this application accepts file arguments only.
Thus I need to create a file with the string, and no trailing space nor CR or LF.
in my batch script I did:
echo.|set /P =%var%>temp.txt
sha256sum temp.txt > temp2.txt
I used the first line to remove CR & LF however in temp.txt file I see a single trailing space char, which is then used by sha256sum.exe.
I am trying to get rid of that trailing space character at the end of the first line of the text file.
I am a linux user and I wasn’t expecting such a simple thing to be a problem.
Thanks in advance.
Simplest thing would be to replace all whitespace;
Edit
Sorry, I didnt realise the extra space was in the written value, how about
I downloaded that sha1sum.exe and for
"hashme"the output is correct;