#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Location
    Wiesbaden, Hessen, Germany
    Posts
    2
    Rep Power
    0
    Hello,

    I'm a newbie to php3 and wanted to convert an asp-site to php3. Therefore I need a bitwise XOR command. I just could find logical XOR and bitwise AND and OR but not bitwise XOR. I know that some mathematicians will laugh about that, but it's a long time ago where I had calculated with this stuff (at least I think it is possible to combine the other bitwise operators, but I don't know how to).

    Please help, thanks in advance.

    simist
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    The caret (^) character is the bitwise exclusive-or operator:

    11 ^ 13 == 6

    (11 is binary 1011
     13 is binary 1101
     06 is binary 0110)

    -- Christopher

    PS - I'm so curious: Why do you need this? When I described these operators in my book, I stated that they were rarely used in PHP. You're making me look bad

    [This message has been edited by scollo (edited February 02, 2000).]
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Location
    Wiesbaden, Hessen, Germany
    Posts
    2
    Rep Power
    0
    Thank you very much Christopher,

    I need bitwise XOR for an decryption engine which I have developed about a year ago. With a good friend we had programmed a small advertising game called "PHYSIKUS DriveIn" ("www.physikus.de", section "DriveIn"). It's a quite funny game with which you can win something. The cryption engine was embedded into VisualBasic and will now be ported to C++ for better performance. With this engine we have encoded the hiscore of the game into an alphanumerical code using a multiple shifting XOR sieve. There are several arrays with secret numbers as XOR sieves which have to be run through by the hiscore. It's a little bit like DES (of course less secure). I had no experience in dynamic web programming that time so we outsourced the online decryption engine to another company which programmed it in ASP. Today we want to make more of these games but don't want to use ASP any more (other companies always take more than i will take for myself...) That's why I want to use PHP for it.

    Well, I made the same experience. I have bought the only two books on PHP which where ever published here in Germany. But both ones, written from different auhtors, doesn't include bitwise XOR even in their reference. One of these books has even 732 pages without the reference part. With reference this book counts over 1000 pages. So I never thought it could be possible that this huge tome could miss anything... But before that I could never imagine to use bitwise XOR, too. It's really not difficult programming but anything else but everyday usage of a programming language.

    So after all I don't think I'm really making you looking bad At least you have mentioned bitwise XOR in contrast to the German books I have bought. Perhaps you can tell me where I can buy your book?

    Thanks again,

    Kar-Wing
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Hi,

    I checked out physikus.de. It looks great. Why don't I get to do the fun projects like that? Vielleicht muss ich wieder nach deutschland umziehen.

    This is the sort of shameless self-promotion that I never thought I would do, but judging from my email, most of the DevShed Discussion Forum people already seem to know about my book anyway. So here you go:
    Professional PHP Programming
    ISBN 1861002963
    If you like the "independent" bookstore thing, you can try http://www.codysbooks.com/ and do a search for "scollo". Or you can find it at the publisher's site: http://www.wrox.com/Consumer/Store/D...SBN=1861002963
    I hope you enjoy it.

    -- Christopher


Similar Threads

  1. Apache2 w/ php4 as DSO.. but I need to revert to php3
    By JunkCookie in forum PHP Development
    Replies: 0
    Last Post: August 11th, 2003, 02:05 PM
  2. Hexidecimal bitwise operations
    By pog in forum MySQL Help
    Replies: 1
    Last Post: October 23rd, 2002, 09:44 PM
  3. cannot read php3 scripts
    By MKashlev in forum PHP Development
    Replies: 1
    Last Post: September 2nd, 2001, 10:48 PM
  4. PHP3 -> PHP4 - how to reconfigure applications?
    By adam2000 in forum PHP Development
    Replies: 1
    Last Post: December 14th, 2000, 01:00 AM
  5. PHP3 and PHP4 together
    By an_easy_marc in forum PHP Development
    Replies: 1
    Last Post: October 20th, 2000, 04:44 AM

IMN logo majestic logo threadwatch logo seochat tools logo