Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: com.Util.CreateDigestString  (Read 9946 times)
Jim M.
Posts: 5


« on: March 17, 2016, 02:52:38 pm »

I need to create an MD5 checksum as part of an xml file being submitted to the IRS.  MD5 is specifically required.

In version 2.5 I am using security.digest and I can specify that MD5 is the algorithm to use.

I need to do the same thing in 2.32 and 2.21.   The only function I can find there is com.Util.CreateDigestString

Can anyone confirm if this is my best option?

Can someone tell me what algorithm is uses?  I don't see any way to tell it what to use.  I do see that the function security.Digest.CreateDigestString creates a SHA1 digest so I'm guessing that the com.Util version does the same thing - but I need MD5.

Thanks for any guidance you can provide.

Sisavanh S.
Four Js
Posts: 80


« Reply #1 on: March 17, 2016, 04:43:08 pm »

Hi,

I'm afraid you do not have the equivalent in 2.32 and 2.21.
An alternative is to use an external command that you launch with RUN, like openssl for example.

Best regards,
Sisa.
Laurent G.
Four Js
Posts: 116


« Reply #2 on: March 17, 2016, 08:57:36 pm »

You can also look into using a Java utility signing method via our Java Bridge (introduced in 2.20) until you get all your programs upgraded to 2.50:
https://4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#c_fgl_JavaBridge_001.html
Jim M.
Posts: 5


« Reply #3 on: March 17, 2016, 09:06:53 pm »

Thank you for your quick responses
Reuben B.
Four Js
Posts: 1126


« Reply #4 on: March 17, 2016, 09:24:10 pm »

Hi,

I'm afraid you do not have the equivalent in 2.32 and 2.21.
An alternative is to use an external command that you launch with RUN, like openssl for example.

Best regards,
Sisa.

As well as openssl, you may find commands such as md5 or md5sum on your O/S (or can be downloaded). 

Also use base.Channel.openPipe instead of RUN if you want to capture what is written to stdout

https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassChannel_openPipe.html
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassChannel_example_2.html

I have also seen someone implement the md5 checksum calculation in 4gl if you want an interesting programming exercise :-)

Reuben



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines