A little php

Discussion of challenges you have already solved
Post Reply
chiffre
Posts: 7
Joined: Fri Nov 27, 2009 2:52 pm

A little php

Post by chiffre »

Finally I got it ;)

But one question: What is really calculated here, or in other words what does the php-solver do?
pSub
Posts: 3
Joined: Tue May 26, 2009 11:28 am
Location: ZZZZZZZZ

Post by pSub »

I think there is nothing special about the calculation.
It is a bit manipulation with xor [0].

10001101001110111 = 72311
10101110110110101 = 89525

00100011111000010 = 18370

[0] http://en.wikipedia.org/wiki/Xor
Masti6
Posts: 55
Joined: Sat May 15, 2010 12:04 pm
Location: Finland, Nurmes

Post by Masti6 »

I did this with Netbeans PHP application, but I was left curious, so I tried this with Python, and succeeded:

Code: Select all

#A little PHP
x = 72311
y = 89525
k = x ^ y
print k
Pretty simple imho, PHP is way more complicated, and this is alot simpler than that PHP one. Again, imo. But it was pretty simple. And I had neither no idea that I could just XOR it between the values.
This was a nice challenge, altho a hard one for those who might not have any experience in PHP;
How to install the environment aka XAMPP, NetBeans, etc.
Translating the code into Python would've been ever better if I was a first-timer in PHP and wouldn't have had the programs needed.
keiya
Posts: 5
Joined: Tue Jun 22, 2010 2:34 am

Post by keiya »

The PHP one was deliberately obfuscated. The only tricky part for me was remembering whether php used ^ for xor or exponentiation.
Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

What about some useful

Post by Aghamemnon »

just use the calculator that comes with Windows
:twisted: Devilish Angel Aghamemnon :twisted:
pyro3o7
Posts: 4
Joined: Sun Nov 28, 2010 5:45 am

A little PHP

Post by pyro3o7 »

I just ran the equation through python :evil: :P
JFox
Posts: 2
Joined: Sat Nov 05, 2011 6:58 pm

Post by JFox »

It is easy, you just have to know how to read an escaped PHP string. Then I just entered 72311^89525 in my JavaScript console, and copy-pasted the result.
Post Reply