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

Tripcodes

Name: Anonymous 2009-02-17 4:10

Anyone please post the algorithm to generate 4chan tripcodes. In whatever language you want (or psuedo code)

Name: Anonymous 2009-02-17 11:56

#### funky tripcode time ###########
# no blank tripcodes plz
if(preg_match("/\#$/", $_POST[name], $match)){
    $_POST[name] = preg_replace("/\#$/", "", $_POST[name]);
}
## ## ## Secure tripcodes courtesy of MrVacBob ## ## ##
# tripcode hashing, 2ch-style and modified Wakaba-style
if (preg_match("/\#/", $_POST[name])) {   
    $_POST[name] = str_replace("&#","&%%%%%%",$_POST[name]); # otherwise HTML numeric entities screw up explode()!
    list ($name,$trip,$sectrip) = str_replace("&%%%%%%", "&#", explode("#",$_POST[name]));
    $_POST[name] = $name;
   
    if ($trip != "") {
        $salt = strtr(preg_replace("/[^\.-z]/",".",substr($trip."H.",1,2)),":;<=>?@[\\]^_`","ABCDEFGabcdef");
        $trip = substr(crypt($trip, $salt),-10);
    }
   
    if ($sectrip != "") {
        $sha = base64_encode(pack("H*",sha1($sectrip.SecureSalt())));
        $sha = substr($sha,0,15);
        $trip .= "#".$sha;
    }
}
# End of tripcode section #############################


How the fuck hard is it to look at the Shiitchan source?

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