Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Paul Gilmartin
On Sun, 10 Mar 2024 02:11:50 +, Seymour J Metz wrote:

>HLASM.
> 
I understand that on Linux HLASM translates ASCII source to EBCDIC on
input and assembles that.

Has anyone written a HLASM base64  decoder that works on both ASCII
and EBCDIC?

Conditional assembly?

Dual path?

Translation on input?

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Seymour J Metz
HLASM.

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי
נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Saturday, March 9, 2024 3:34 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BASE64 Decode / EPOCH Conversion Code Samples

On Sat, 9 Mar 2024 19:47:13 +0200, Binyamin Dissen wrote:
>
>Actually not, as the base64 document survives character conversion.
>
I agree there's no loss of information.

>An assembler routine running using EBCDIC will provide the same result (with
>EBCDIC) as the routine running using ASCII with ASCII, i.e., 'A' translates to
>the same binary code on both systems.
>
What assembler runs on both ASCII and EBCDIC systems?

There's an ambiguity.  If you don't know whether your base64 is represented
in ASCII or EBCDIC, suppose it contains the character at code point x'4E'.
You don't know whether that's an EBCDIC '+' or ASCII 'N'.  It matters.

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Binyamin Dissen
On Sat, 9 Mar 2024 14:34:35 -0600 Paul Gilmartin
<042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote:

:>There's an ambiguity.  If you don't know whether your base64 is represented
:>in ASCII or EBCDIC, suppose it contains the character at code point x'4E'.
:>You don't know whether that's an EBCDIC '+' or ASCII 'N'.  It matters.

It is the character set of the platform. The base64 source is supposed to be
transmitted as text so whichever platform receives it expects 'A' to be 'A' in
their character set.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Paul Gilmartin
On Sat, 9 Mar 2024 19:47:13 +0200, Binyamin Dissen wrote:
>
>Actually not, as the base64 document survives character conversion.
> 
I agree there's no loss of information.

>An assembler routine running using EBCDIC will provide the same result (with
>EBCDIC) as the routine running using ASCII with ASCII, i.e., 'A' translates to
>the same binary code on both systems.
>
What assembler runs on both ASCII and EBCDIC systems?

There's an ambiguity.  If you don't know whether your base64 is represented
in ASCII or EBCDIC, suppose it contains the character at code point x'4E'.
You don't know whether that's an EBCDIC '+' or ASCII 'N'.  It matters.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Binyamin Dissen
On Sat, 9 Mar 2024 00:21:32 -0600 Paul Gilmartin
<042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote:

:>>It is a means of converting binary data to commonly printable characters
:>>(typically A-Z a-z 0-9 + /)  that can then be shipped in a non-binary manner.

:>To an assembler program it is almost certain to matter whether "A-Z a-z 0-9 + 
/"
:>are in ASCII or EBCDIC representation.

Actually not, as the base64 document survives character conversion.

An assembler routine running using EBCDIC will provide the same result (with
EBCDIC) as the routine running using ASCII with ASCII, i.e., 'A' translates to
the same binary code on both systems.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Paul Gilmartin
On Sat, 9 Mar 2024 08:46:01 -0600, Joel C. Ewing wrote:
>...
>If you really want the BASE64 encoding to be in EBCDIC characters,  and
>also a conversion of a binary value to be interpreted and displayed in
>EBCDIC, I would think it much more useful to keep these as  two
>independent routines.
>
If it were coded in a HLL as a 64-branch SWITCH statement, it would
work alike on an ASCII platform with ASCII encoded input and on an
EBCDIC platform with EBCDIC encoded input, producing identical
binary output for both.

An outboard ICONV filter  might be useful.


>>> On Wed, 6 Mar 2024 06:11:01 + Frank Bonaduce wrote:
>>>
>>> :>Hello Folks. Is anyone aware of where one might locate any sample 
>>> assembler code, macros or APIs to perform the following:
>>> :>- Base64 Decoding (to EBCDIC)- EPOCH Conversion
>>> :>Thanks in advance for the assistance.� �Frank.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: BASE64 Decode / EPOCH Conversion Code Samples

2024-03-09 Thread Joel C. Ewing
Your requirement was confused by adding  "epoch conversion". Sounded 
like you  expected one routine to decode a BASE64-encoded string (which 
in most contexts is 7-bit ASCII as octets) interpret the binary as an 
epoch timestamp, and generate displayable EBCDIC characters.


Now its sounds like you're looking a BASE64 encode/decode where the 
(presumably) same glyphs are used to represent the base-64 digits are 
EBCDIC rather than ASCII character codes.   I suppose someone may have 
done that, but you would end up with octets that require all 8  bits to 
represent the characters, which would be a different goal than the 
original ASCII usage.


If you really want the BASE64 encoding to be in EBCDIC characters,  and 
also a conversion of a binary value to be interpreted and displayed in 
EBCDIC, I would think it much more useful to keep these as  two 
independent routines.


Joel C Ewing

On 3/9/24 00:21, Paul Gilmartin wrote:

On Wed, 6 Mar 2024 09:59:02 +0200, Binyamin Dissen wrote:


Base64 has nothing to do with EBCDIC.


???


It is a means of converting binary data to commonly printable characters
(typically A-Z a-z 0-9 + /)  that can then be shipped in a non-binary manner.


To an assembler program it is almost certain to matter whether "A-Z a-z 0-9 + /"
are in ASCII or EBCDIC representation.



A simple duck-duck-go search will show examples. My first C program was a base
64 converter.

On Wed, 6 Mar 2024 06:11:01 + Frank Bonaduce wrote:

:>Hello Folks. Is anyone aware of where one might locate any sample assembler 
code, macros or APIs to perform the following:
:>- Base64 Decoding (to EBCDIC)- EPOCH Conversion
:>Thanks in advance for the assistance.� �Frank.


--
Joel C. Ewing

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN