-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 02, 2003 2:20 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: UNIX : script help/input
Raj,
I did consider doing it this way, but the thought of writing stuff to the
bit level for a prototype was just too painful.
Left pad with zeroes, take a substring, feed it to the handy-dandy
hex/oct/bin/dec converter package - much easier.
Jared
"Jamadagni, Rajendra" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]10/02/2003 05:54 AM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:
Subject: RE: UNIX : script help/input
XOR .... that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a "C" encryption code to pl/sql and then use utl_tcp to sent it to our router which feeds the modem banks.This is how I worked on it ... but I was working on character by character ...
xor(a,b) is
r_a := utl_raw.cast_to_raw(chr(a));
r_b := utl_raw.cast_to_raw(chr(b));
n_xor := to_number(utl_raw.bit_xor(r_a,r_b),'xxxx');
Of course the manual doesn't tell you this ...
Raj
--------------------------------------------------------------------------------
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !
-----Original Message-----
Sent: Wednesday, October 01, 2003 6:29 PM
To: Multiple recipients of list ORACLE-L
> Good! The more the merrier! Welcome to the club.
Oh most definitely.
As I just finished writing a prototype package for assigning MAC
addresses ( we make network stuff - that's a technical term ), I
have endured the agonies of doing hex math in PL/SQL.I finally bit the bullet and used string manipulation to convert
hex to decimal and do what I needed that way. Couldn't get BITAND
to work properly on very large integers. Besides, doing XOR with
BITAND in PL/SQL is very painful.UTL_RAW has an XOR, but it requires RAW values and I didn't feel
like messing with it.This is all very simple in Perl.
Given a MAC of 000050000AA, with a fixed portion of 00005000000,
it is very easy to determine the variable portion of the address
via $x = 0x000050000AA ^ 00005000000.Not quite so simple in PL/SQL.
Jared
unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted
feed that we send out to our clients ... it is decoded by a
chip.
Oh
well .... I am back to array of references ...
Raj
- Re: UNIX : script help/input Jared Still
- Re: UNIX : script help/input Govindan K
- RE: UNIX : script help/input Mladen Gogala
- Re: UNIX : script help/input Jared Still
- RE: UNIX : script help/input Jared Still
- Re: UNIX : script help/input Vladimir Begun
- RE: UNIX : script help/input Jamadagni, Rajendra
- RE: UNIX : script help/input Norris, Gregory T [ITS]
- Re: UNIX : script help/input Don Yu
- RE: UNIX : script help/input Jared . Still
- Re: UNIX : script help/input Jamadagni, Rajendra
- Re: UNIX : script help/input Vladimir Begun
- Re: UNIX : script help/input Vladimir Begun
- RE: UNIX : script help/input Jamadagni, Rajendra
- Re: UNIX : script help/input Jared . Still
- Re: UNIX : script help/input Jared . Still