× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Raul

Nice use of 2 MI functions - I should have used _CIPHER in my webcast - for this one, at least, it's a very easy thing to use.

One thought - the Cipher prototype can be specified using standard variables, maybe like parmInput, instead of using pointers by value - if possible, it is preferable not to pass pointers by value, since there is no validation.

Also, you must have the dsControls structure defined somewhere else, right?

Again, nice example - thanks!
Vern

On 3/28/2018 9:35 AM, Raul Jager wrote:
I use a routine to get sha1,  changing the "HashAlgoritm will give you
sha256. (find _CIPER)

 // Return a SHA 1 as a 40-byte character value (hex) - input in EBCDIC
PSHA1             B                   Export
DSHA1             PI            40
D parmInput                  32000    Options(*VarSize) Const Varying
     HashAlgorithm = x'01';
     HashWorkArea  = *LOVAL;
     DataLength=%Len(parmInput);
     Input=parmInput;
     Translate(DataLength: Input: 'QTCPASC');
     Cipher(%Addr(ptrOutput):
            %Addr(dsControls):
            %Addr(ptrInput));
     // Convert hash string to character
     cvthc(OutputHex:
           Output:
           %Size(OutputHex));
     Return %xlate('ABCDEF': 'abcdef': OutputHex);

PSHA1             E

// procedure to call MI

DCipher           PR                  EXTPROC('_CIPHER')
D                                 *   VALUE
D                                 *   VALUE
D                                 *   VALUE



On 03/27/2018 01:53 PM, broehmer@xxxxxxxxxxxxxxx wrote:
Oh. Sorry. Required by IRS for ACA electronic submission.
Found out about it when we submitted our files and it burped
with the checksum. Had a few nasty remarks to myself since
I hadn't looked at it since October.



Bill Roehmer
Senior Pgmr/Analyst
The C.D. Hartnett Company

817 594-3813 ext. 1631


"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments
accompanying it) contain confidential information belonging to the sender.
The information is intended only for the use of the intended recipient.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance
on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the law.
If you have received this transmission in error, please promptly notify
the sender by reply e-mail, and then destroy all copies of the
transmission."






From: Charles Wilt <charles.wilt@xxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>
Date: 03/27/2018 12:50 PM
Subject: Re: MD5R4-SHA256
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>



I understand it's a checksum...

What are you using that checksum for?

Why do you need SHA256?

If you're publicly post the file and using the MD5 has for integrity
checking for people who download it, I could understand wanting to update.

For purely internal or trusted use, MD5 would be just fine.

Charles


On Tue, Mar 27, 2018 at 11:44 AM, <broehmer@xxxxxxxxxxxxxxx> wrote:

It's a checksum for the file. Right now the MD5R4 returns a 32
character
field.

streamfile = %trimr(xmlfilefull);
augment = gethashmd5(streamfile);

I'm guessing the field will become 64.
There wasn't any conversion that I can see but
then the file exists in the ifs so...








From: Charles Wilt <charles.wilt@xxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>
Date: 03/27/2018 12:37 PM
Subject: Re: MD5R4-SHA256
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>



What do you intend to do with the hash?

Note that unless it will be used on an i somehow...you might need to
convert the data from EBCDIC to ASCII first; then do the hash..

Charles

On Tue, Mar 27, 2018 at 10:12 AM, <broehmer@xxxxxxxxxxxxxxx> wrote:

Hi All,

I've a need to either change or find a program that does what Scott
Klement's program MD5R4
that creates a SHA1 hash to SHA256. Anybody know what can be done
with
Scott's program
to make it work?


Bill



"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the
attachments
accompanying it) contain confidential information belonging to the
sender.
The information is intended only for the use of the intended
recipient.
If
you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in
reliance
on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the
law.
If you have received this transmission in error, please promptly
notify
the
sender by reply e-mail, and then destroy all copies of the
transmission."
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD



"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the
attachments
accompanying it) contain confidential information belonging to the
sender.
The information is intended only for the use of the intended recipient.
If
you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in
reliance
on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the law.
If you have received this transmission in error, please promptly notify
the
sender by reply e-mail, and then destroy all copies of the
transmission."
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.