Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: UNIX : script help/input

RE: UNIX : script help/input

From: <Jared.Still_at_radisys.com>
Date: Thu, 02 Oct 2003 10:19:39 -0800
Message-ID: <F001.005D1D58.20031002101939@fatcity.com>


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" <Rajendra.Jamadagni_at_espn.com> Sent by: ml-errors_at_fatcity.com
 10/02/2003 05:54 AM
 Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        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


Content-Type: text/plain; name="ReadMe.txt"; charset="us-ascii" Content-Transfer-Encoding: 7bit

The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.

This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.

--=_mixed 005EEE4788256DB3_=--

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: Jared.Still_at_radisys.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Received on Thu Oct 02 2003 - 13:19:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US