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

Tripcodes

Name: Anonymous 2018-10-01 4:03

How are tripcodes generated?

Name: Anonymous 2018-10-01 16:25

>>6
The algorithm is:
1. convert the input to Shift JIS. (you can skip that if you don't need japanese tripcodes)
2. Generate the salt as follows:
- Take the second and third characters of the string obtained by appending H.. to the end of the input.
- Replace any characters not between . and z with ..
- Replace any of the characters in :;<=>?@[\]^_` with the corresponding character from ABCDEFGabcdef
3. Call the crypt() function with the input and salt.
4. Return the last 10 characters.

You need the old Unix crypt function (DES), see man 3 crypt.

shiichan's code:
$salt = strtr(preg_replace("/[^\.-z]/",".",substr($trip."H.",1,2)),":;<=>?@[\]^_`","ABCDEFGabcdef");
$trip = substr(crypt($trip, $salt),-10);

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