Title: 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-----
From: Jared Still [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 01, 2003 6:29 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: UNIX : script help/input


> 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

********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************2

Reply via email to