Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Trip-codes

Name: Anonymous 2007-08-15 9:47 ID:rAGjFXj3

What's a good way to generate trip codes like 4chan uses?  Taking the user IP as an argument.

Name: nigger 2009-04-13 0:22

DOUBLE NIGGER

Name: !a2uDFch6hM 2009-05-16 12:08

ddd

Name: JOHO 2009-05-31 21:24

am i trippin yet

Name: Anonymous 2009-05-31 21:51

>>25
non-free shit.

Name: test !!W4juMWQJc0pBDvC 2009-06-08 12:18

asdf

Name: !XpWnBlKJp6 2009-06-10 13:45

hi

Name: Anonymous 2009-06-15 12:30



  for($i=0; $i<strlen($crypt); ++$i) {
     $trip .= $ALPHABET[ord($crypt[$i]) % strlen($ALPHABET)];
  }

Name: Anonymous 2009-06-15 12:33

derp

Name: moot !Ep8pui8Vw2 2009-06-15 12:53

sup

Name: moot !Ep8pui8Vw2 2009-06-15 14:35

>>49
I see what you did there, scoundrel.

Name: Anonymous 2009-06-15 16:40

>>50

LOL I TROL U

Name: Anonymous 2009-06-15 20:17

I can't tell which post I need to be originally disgusted by

I'll go with
>>-1

Name: Anonymous 2009-08-18 0:02

<?php
  $ALPHABET = "0123456789!ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

function tripcode($ip) {
  $ip = "127.0.0.1";
  $salt = date();
  $crypt = crypt($ip, $salt);
 
  $trip = "";
  for(int i=0; i<strlen($crypt); i++) {
     int idx = ((int) $crypt[i]) % strlen($ALPHABET);
     $trip .= $ALPHABET[idx];
  }

  return $trip;
}
?>

Name: Anonymous 2009-08-18 2:00

>>53
Protip: your lookup table isn't going to be faster than strtr or manual comparisons, because PHP does it as a hashmap.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 2:29

>>55 Hashtables? Fastest data structure? That like claiming C++ is the fastest language.
Indexed arrays are obviously faster pointer+[cell_address] and have zero overhead.



_______________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The trouble with the rat race is that even if you win, you're still a rat.

Name: Anonymous 2009-08-18 2:39

>>56
That like claiming C++ is the fastest language.
No actually, it's not. C++ does not win the speed game in any problem domain. Anything it is reasonably good at C does better. The same can't be said for a hashtable, which has constant time insertion, lookup, and deletion. You won't find such behavior in any other data structure. I'm not sure what you are trying to say regarding indexing vs pointer arithmetic, but if you are arguing that either one of them is faster, you are wrong.

Name: Anonymous 2009-08-18 2:40

>>55
Better big-O performance doesn't always mean faster. The constant time required for PHP's hashtable implementation is considerably longer than the constant time that would be required for the strtr implementation, which is bigger than the constant time required for the straightforward comparison implementation.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 2:47

>>57 constant time insertion, lookup, and deletion.
If you're using array as storage, insertion is just adding more cells at the end or replacing unused(zero) cells
while deletion is zeroing the cell.Lookup is obviously faster(its just goto base+index*cell_size) while hashmap require spending time with hashfunctions.



_______________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Doctor, will you tell these fools? I'm not crazy. Make them listen to me before it's too late.

Name: Anonymous 2009-08-18 3:13

>>59
Are you fucking retarded? I meant find, which is synonymous with lookup. Obviously you have never actually used a hashtable before. It similarly looks like you've never actually used an array before thanks to this amusing number:
while deletion is zeroing the cell
Keep embarrassing yourself, please.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 3:15

>>61 Thats how i use arrays, and your hashfail can't ever come close to their speed.



___________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
A different conception of society, very different from that which now prevails, is in process of formation.

Name: Anonymous 2009-08-18 3:25

>>62
You use them by never needing to find an element in them? Interesting way to COMPLETELY FUCKING IGNORE THE DOWNSIDE. Guess what? I never use a hashtable to hash anything, so the effective time is zero, much faster than a garray. Beat that. Also, rather ironically, if you use a modern compiler the difference in speed between a hashmap and an array should be neglible. I doubt you will test this yourself or consider something that doesn't agree with your "beliefs" but most modern compilers actually produce faster code for a std::vector than an array.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 3:35

>>63 if i intended to use array as database for finding stuff i'll rather use:
http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree



_____________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Attaining one's dream requires a stern will and unfailing determination.

Name: Anonymous 2009-08-18 4:17

>>64
You have no clue when it comes to data structures do you? You took the original problem, made a blind comment that hashtables aren't the "fastest" data structure. Now when it turns out the argument doesn't suit you, you manage to get the idea (or rather force it for lack of anything meaningful to say) that somebody needs a database. No, nobody wants a database. A hashtable isn't intended to be a database. Stop juggling around saying "oh what about x, oh no y, thats not right when I could do z."

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 4:19

>>65 If you don't need a database, then you use plain indexed arrays.
If you need database you use a database.


______________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Biologists or philosophers cannot conceive a biosphere or noosphere because they are unwilling to abandon a certain narrow conception of individuality. Nevertheless, the step must be taken. For in fact, pure spirituality is as unconceivable as pure materiality. Just as, in a sense, there is no geometrical point, but as many structurally different points as there are methods of deriving them from different figures, so every spirit derives its reality and nature from a particular type of universal synthesis.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 4:27

Lets see what you using data for:
1.Searching non-sorted,unorganized data.
2.Storing data for use.
Which?
____________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Tragedy, for me, is not a conflict between right and wrong, but between two different kinds of right.

Name: Anonymous 2009-08-18 4:33

>>65
You're wasting your time.

Name: Anonymous 2009-08-18 4:38

$cap = mb_convert_encoding($cap, 'SJIS', 'UTF-8');



$salt = substr($cap . 'H..', 1, 2);

$salt = ereg_replace('[^\.-z]', '.', $salt);

$salt = strtr($salt, ':;<=>?@[\\]^_`', 'ABCDEFGabcdef');


$trip = substr(crypt($cap, $salt), -10);


Now, what are we talking about again?

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-18 4:46

>>69  I don't see why you even need arrays for this.


______________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Patriotism is your conviction that this country is superior to all other countries because you were born in it.

Name: Anonymous 2009-08-18 4:52

FV is DQN.
ignore him, idiots.
</thread>

Name: Anonymous 2009-08-18 13:51

>>57,61,63,65
You should be shot for considering a hashtable on constant data with contiguous integer keys.  Hashtables are reasonably fast at being hashtables and terrible at everything else.  Also, FrozenVoid is smarter than you.

Name: Anonymous 2009-08-18 19:42

>>72
I didn't suggest using a hashtable with contiguous integer keys. You would know this if you had actually read the posts you quoted, how you managed to not do this escapes me because it seems like a catch 22.
IHBT

Name: !Cv4lpQYkvs 2009-11-09 20:09

oO

Name: Anonymous 2009-11-09 23:29

>>72

Hashtables are reasonably fast at being hashtables and terrible at everything else.

No shit, sherlock.

Name: Anonymous 2009-11-10 0:47

>>75
And yet the person I was responding to hadn't caught on.  Perhaps you should read the thread more carefully.

Name: Anonymous 2009-12-13 3:20

itt: niggers

Name: TRIP !myANUSf.x. 2009-12-13 6:47

­

Name: sage 2009-12-13 7:30

>>40
Please fuck off.

Name: SomeGuye01f8b 2010-01-08 0:59

test

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List