Messages - JoTo [ switch to compact view ]

Pages: prev1 ... 13 14 15 16 17 [18] 19 20 21 22 23 ... 46next
86
Hi RedPillow again,

YW!

Yes, array_flip exchanges keys with values and vice versa in an array.

You can use the same slightly changed lines to reverse the cryption.

Just split the crypted string with str_split again and use the length parameter with value 3 to get chunks of 3 chars in each array element.
Then use the same foreach construct to search for keys (formerly the values) in cryptkey and replace it by the values (formerly the keys) and you should be there.

Good luck
JoTo

87
Hi RedPillow,

i think your problem is, that str_replace finds already replaced characters in your string and replace it again and again and again.

This version of your slightly adapted script works for me. Maybe give it a try.

Code: PHP [Select]
  1. <?php
  2. //This is the key-table for crypter.
  3. $cryptkey = array('0' => 286, '1' => 949, '2' => 695, '3' => 348, '4' => 438, '5' => 977,
  4.                   '6' => 320, '7' => 418, '8' => 970, '9' => 482, '[' => 466, ']' => 770,
  5.                   '.' => 569, ' ' => 242, '-' => 166, 'A' => 583, 'B' => 575, 'C' => 247,
  6.                   'D' => 564, 'E' => 192, 'F' => 513, 'G' => 653, 'H' => 605, 'I' => 450,
  7.                   'J' => 404, 'K' => 831, 'L' => 315, 'M' => 953, 'N' => 439, 'O' => 266,
  8.                   'P' => 231, 'Q' => 633, 'R' => 881, 'S' => 113, 'T' => 935, 'U' => 559,
  9.                   'V' => 318, 'W' => 927, 'X' => 906, 'Y' => 463, 'Z' => 184, 'a' => 263,
  10.                   'b' => 453, 'c' => 208, 'd' => 591, 'e' => 511, 'f' => 343, 'g' => 969,
  11.                   'h' => 415, 'i' => 420, 'j' => 175, 'k' => 410, 'l' => 295, 'm' => 265,
  12.                   'n' => 877, 'o' => 200, 'p' => 837, 'q' => 913, 'r' => 515, 's' => 262,
  13.                   't' => 524, 'u' => 874, 'v' => 525, 'w' => 700, 'x' => 670, 'y' => 918,
  14.                   'z' => 290, '<' => 331, '>' => 533, "'" => 425, ',' => 101, ':' => 495,
  15.                   '$' => 114, '\\' => 268, '/' => 721, '=' => 454);
  16. //Don't mind about some flaws in table ... solving them later.
  17.  
  18. // Just some dummy values to keep PHP happy :)
  19. $curdate = "03/28/2011";
  20. $color = "#ffffff";
  21. $rotation = "RoundItGoes";
  22. $ip = "192.168.0.1";
  23. $msg = "Hello world!";
  24.  
  25. //This is the string we're going to crypt.
  26. $notcrypted1 = "[$curdate] - Rotation was <font color = '$color'><b>$rotation</b></font> degrees, done by <b>$ip</b>, who says: ''<b>$msg</b>''\r\n";
  27.  
  28. //Splitting the string here.
  29. $split1 = str_split($notcrypted1);
  30.  
  31. // Replace the characters in the string with their crypted equivalents
  32. foreach($split1 as $key => $value)
  33. {
  34.     if(array_key_exists($value, $cryptkey))
  35.         $split1[$key] = $cryptkey[$value];
  36.     else
  37.     {
  38.         // An error occurred, the character is not present in the cryptkey table
  39.         // do sth. like outputting an error or inserting a special number or the original
  40.         // character or whatever
  41.         print "OOPS! An error occurred. Do something, QUICK! :)";
  42.     }
  43. }
  44.  
  45. // Joining again to get back a single string
  46. $crypted1 = implode("", $split1);
  47.  
  48. // Output the crypted result
  49. print "\nCrypted result is: <".$crypted1.">\n";
  50. ?>

I get this result string from it:
Crypted result is: <466286348721695970721695286949949770242166242881200524263524420200877242700263262242331343200877524242208200295200515242454242425#343343343343343343425533331453533881200874877591450524653200511262331721453533331721343200877524533242591511969515511511262101242591200877511242453918242331453533949482695569949320970569286569949331721453533101242700415200242262263918262495242425425331453533605511295295200242700200515295591!331721453533425425
>

What looks correct for me, in the way you described your goal, when i check some samples manually.

Hope this helps!

Greetings
JoTo

88
Hey mouseman,

i just want to give you a thumbs up. You know, while i'm a nearly daily IRC member of the DC channel i'm not a everyday forum reader. But i read your event updates EVERYDAY.

So to answer your question. YES, at least i - and i'm sure hundred others, read your daily update posts.

And thanks also to all of those fundraiser participants that write that apps, reviews, stories, hints, political speeches ... HUH???? errrrr...cancel that last one please. :) Good work, please go on.

Greetings
JoTo

PS:
Maybe this was a test, but i noticed that the post for 14th is missing! GOTCHA and proofed that i read them. :)

89
Hi,

for those of you BoardGameGeeks i have a suggestion.

I am a long time member of http://www.brettspielwelt.de (BoardGamesWorld).

BSW is a site where you can play online and FREE many original boardgames. From Settlers of Catan, over Pandemic to Dogz and whatnot. All the games are licensed with the original publishers and so they look relatively genuine (original graphics, gameplay and rules). The publishers count the BSW as a kind of advertisement for their games. And it worked for me. When i joined the BSW i played Pandemic the first time. I loved it so much that i purchased the game as a board game -> DANG! Money for the publisher via BSW. :)

In BSW there is a Metagame that is organized in a kind of "World" with towns and Guilds and Ranks/Levels. So you can go from town to town where games in "houses of the town" are offered to play. Lounges and shouts makes it easy to find opponents. Also there are a lot of people around all the day and 24/7. At the time i write this post 1200+ players were online.

Regular tournaments and events completes the scenario. The Metagame is a nice addon, but not the main thing. If you register you can get a citizen of a town and play for this town in tournaments and earn money for the town (that is needed to purchase food, pay tax and whatnot). Or you just enter, wade to the game you want, play some matches and walk away again. It's at your will.

Oh and did i mentioned its completely FREE. You even don't need to register. You can play as Guest. But then you miss a lot of fun of rankings and levels. But even if you register, i never got a single email from them, except the register/welcome one.

Don't be afraid that this is a german page and the homepage is all german. There are a lot of foreign (non german) members there and english spoken is BSW-wide from a lot of persons there. There are even founded towns in the BSW-Metagame with english speaking or regional persons (e.g. London for British people or Istanbul for Turkish).

E.g. there is a special forum board for english only at: BSW English Forum

So maybe we meet you some times in the world of BSW. My nickname (What do you think? Surprise, Surprise!) is of course not JoTo. :) Was already taken. I am Lukullus there.

Hope this suggestion is valuable for someone.

Greetings
JoTo

90
Hi Stephen,

How about if we had the fundraiser items (Reviews, Coding Snacks etc) all posted into a special area, that only those who have pledged (and submitted one pledge to mouser, or a Fundraiser admin for sumittion into the area) and those who have donated in the month of March; can access.

This area will be something like the area that is currently only available for anybody with the "Supporting Member" title, and will act as sort of a "Pre-Release Room".  Once the fundraiser has finished, one whole month will pass before the posts go public (May 1st).

Sorry, i think your idea is contra productive.

I understand the fundraiser idea in that way to convince people to visit our pages regularly as they are curious what we got new this day and the next day and the next ...

Following your idea is to burn the whole firework rockets in one bunch at the same time instead of enjoying the spectacle over a longer time.

People just think, ok, they release it at 1st, May, then i'll come back then and read them all at once.

I think to have people on our pages every day for whole march and see all the other new posts too (not only the fundraiser related) and the donation thermometer and seeing your new tattoo that you'll get every day (:) SCNR - hehehe) is the most important thing. So visiting DC site can become a kind of "tradition" for them and may last over the end of march too.

Just my 2ct.
Greetings
JoTo

Pages: prev1 ... 13 14 15 16 17 [18] 19 20 21 22 23 ... 46next
Go to full version