×
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.
d main PR ExtPgm('GENHASHR')
d InputData 4096
d InputDataLen 10i 0
d HashAlg 10i 0
d Hash 64
d HashHex 128
d main PI
d InputData 4096
d InputDataLen 10i 0
d HashAlg 10i 0
d Hash 64
d HashHex 128
d Qc3CalculateHash...
d PR ExtProc('Qc3CalculateHash')
d InData * value
d IndataL 10i 0 const
d InDataF 8a const
d AlgoDes 16a const
d AlgoFmt 8a const
d CryptoSP 1a const
d CryptoDev 1a const options(*omit)
d Hash 64a options(*varsize:*omit)
d ErrorCode 32767a options(*varsize)
d ALGD0500_t ds qualified
d based(Template)
d HashAlg 10i 0
d QDCXLATE PR ExtPgm('QDCXLATE')
d len 5p 0 const
d data 32702a options(*varsize)
d table 10a const
d iconv_t DS qualified
d based(StructureTemplate)
d return_value 10I 0
d cd 10I 0 dim(12)
d QtqCode_T DS qualified
d CCSID 10I 0 inz
d ConvAlt 10I 0 inz
d SubsAlt 10I 0 inz
d ShiftAlt 10I 0 inz
d InpLenOp 10I 0 inz
d ErrorOpt 10I 0 inz
d Reserved 8A inz(*ALLx'00')
d iconv_code_t DS qualified
d owner 8a inz('IBMCCSID')
d CCSID 5a inz('00000')
D ReservedTo
d ConvAlt 3a inz('000')
D overlay(ReservedTo)
d SubsAlt 1a inz('0')
D overlay(ReservedTo:*next)
d ShiftAlt 1a inz('0')
D overlay(ReservedTo:*next)
d InpLenOpt 1a inz('0')
D overlay(ReservedTo:*next)
d ErrorOpt 1a inz('0')
D overlay(ReservedTo:*next)
d ReservedFrom 12A inz(*ALLx'00')
D overlay(ReservedTo:*next)
d QtqIconvOpen PR extproc('QtqIconvOpen')
d like(iconv_t)
d toCode likeds(QtqCode_t) const
d fromCode likeds(QtqCode_t) const
D iconv_open PR extproc('iconv_open')
D like(iconv_t)
D toCode like(iconv_code_t) const
D fromCode like(iconv_code_t) const
d iconv PR 10U 0 extproc('iconv')
d cd like(iconv_t) value
d inbuf *
d inbytesleft 10U 0
d outbuf *
d outbytesleft 10U 0
d QlgTransformUCSData...
d PR 10U 0 extproc('QlgTransformUCSData')
d xformtype 10i 0 value
d inbuf *
d inbytesleft 10U 0
d outbuf *
d outbytesleft 10U 0
d outspacereq 10U 0
D ICONV_FAIL C CONST(4294967295)
D iconv_close PR 10I 0 extproc('iconv_close')
D cd like(iconv_t) value
*----------------------------------------
d source ds likeds(QtqCode_t)
d inz(*likeds)
d target ds likeds(QtqCode_t)
d inz(*likeds)
d toEBC ds likeds(iconv_t)
D p_input s *
D p_output s *
D inputleft s 10u 0
D outputleft s 10u 0
d cvthc PR ExtProc('cvthc')
d target 65534A options(*varsize)
d src_bits 32767A options(*varsize) const
d tgt_length 10I 0 value
d ErrorNull ds qualified
d BytesPro 10i 0 inz(0)
d BytesAvai 10i 0 inz(0)
d HASH_MD5 c 1
d HASH_SHA1 c 2
d HASH_SHA256 c 3
d HASH_SHA384 c 4
d HASH_SHA512 c 5
d MD5Hex s 32
d SHA1Hex s 40
d SHA256Hex s 64
d SHA384Hex s 96
d SHA512Hex s 128
d data s 4096A
d len s 10u 0
d DataToHash s 4096A
d DataLen s 10u 0
D outputbuf s 4096a
D outputlen s 10u 0
d alg ds likeds(ALGD0500_t)
d binHash s 64a
d $hex s 128a
/free
// when InputData defined as varying use following:
// data = InputData;
// len = %len(InputData);
data = %Subst(InputData : 1 : InputDataLen);
len = InputDataLen;
//Set the HASH Algorithm you want to use !
alg.HashAlg = HashAlg ;
//Convert from EBCDIC to ASCII (skip this step if you want Hash in EBCDIC)
// QDCXLATE(len: data: 'QTCPASC');
// set conversion from 937 to 950
// -----------------------------------------------
if (toEBC.return_value = -1);
// handle error...
endif;
// -----------------------------------------------
// Translate data.
//
// the iconv() API will increment/decrement
// the pointers and lengths, so make sure you
// do not use the original pointers...
// -----------------------------------------------
// -----------------------------------------------
// if needed, you can calculate the length of
// the decoded data by subtracting the amount
// of space left in the buffer from the total
// buffer size.
//
// At this point, 'outputbuf' should contain
// the EBCDIC data.
// -----------------------------------------------
// -----------------------------------------------
// when you are completely done, call iconv_close()
// to free up memory.
// -----------------------------------------------
iconv_close(toEBC);
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.