Is this what you're looking for?

http://www.php.net/manual/en/language.operators.bitwise.php

-----Original Message-----
From: Tom Beidler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 2:33 PM
To: php list
Subject: [PHP] slightly ot, looking for definition and possible info
link about EX-OR


I have a client that is looking to generate unlock codes for a cd and has
given me a calculation that is new to me. There are a number of numbers
associated with each CD, i.e. CD id, CD serial #, hardware code. Based on
the info entered, they've provided a calculation that can be used to
generate an unlock code, ie. Example: ABCD-12AZ-RTG5-02GH-CSWZ-76TG.

I was wondering if this is possible using PHP and where I might get more
information on such a topic.

Here are two parts to the calculation;

(4) The serial # of the CD (6 digits) is converted to the 20 bits binary
code. 

This looks like it should be simple using decbin();

Here's another part;

(11) The 112 bits are divided by 8 bits, then there are 14 bytes.  These 14
bytes is calculated by EX-OR.  Then the result is added to the last, and the
total data becomes 120 bit.

Not too sure about dividing bits and EX-OR. Where could I get more
information about doing something like this.

Once again, I'm not sure if this is possible using PHP and any other
additional information would be greatly appreciate. Also let me know if the
entire calculation would help.

Thanks,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.                                                                       

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to