Page 1 of 1

[Solved] Concatenate Text with runret

Posted: 15 Oct 2021 17:52
by VeeGee
Good morning all,
I am currently using the following command inside the hamburger menu to generate the SHA384 digest/value for use with SRI :

Code: Select all

::SRI;text runret("cmd /c (openssl dgst -sha384 -binary ""<curitem>"" | openssl base64 -A)");
The command gives me exactly what I need; however, it is possible to add SHA384- to the front and = to the end of the results ?

What I get :

Code: Select all

taypC/lgIKbdRmQuUHuXbIjypj1VvSCfLG19MKAVOWlZoJEw0yPXDDV8MarCALXM
What I would like to get :

Code: Select all

SHA384-taypC/lgIKbdRmQuUHuXbIjypj1VvSCfLG19MKAVOWlZoJEw0yPXDDV8MarCALXM=
Also, 2 semi-related questions :
1) When the results are displayed in the text box, if I just click the Copy button, the results are copied to the clipboard PLUS a carriage return. Without manually selecting the text and doing the copy, any tweak that doesn't add a closing carriage return ?

2) Is it possible to add SHA384 to the scripting hash command ? Currently it goes from SHA256 to SHA512.

Many thanks.

Re: Concatenate Text with runret

Posted: 15 Oct 2021 18:22
by highend

Code: Select all

::SRI;text "SHA384-" . runret("cmd /c (openssl dgst -sha384 -binary ""<curitem>"" | openssl base64 -A)") . "=";
1.) There is no tweak and there isn't a <CRLF> here either when doing this. Trim the output?

Re: Concatenate Text with runret

Posted: 15 Oct 2021 19:30
by VeeGee
Thanks ! Worked perfectly and I added a trim() to the results and that solved my other issue. Completely forgot about the dot - I tried &, +, etc.