[Solved] Concatenate Text with runret

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
VeeGee

[Solved] Concatenate Text with runret

Post 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.
Last edited by VeeGee on 15 Oct 2021 19:31, edited 1 time in total.

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Concatenate Text with runret

Post 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?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

VeeGee

Re: Concatenate Text with runret

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

Post Reply