From 7d736c102b956bf9dfaf3cb7bae0e8a130393801 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 13 Apr 2011 20:02:58 +1000 Subject: poster IDs --- inc/functions.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 8f36cfb5..e37a367d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1159,9 +1159,16 @@ reset($objects); rmdir($dir); } - } + } + + function poster_id($ip, $thread) { + global $config; + + // Confusing, hard to brute-force, but simple algorithm + return substr(sha1(sha1($ip . $config['secure_trip_salt'] . $thread) . $config['secure_trip_salt']), 0, $config['poster_id_length']); + } - function generate_tripcode ( $name, $length = 10 ) { + function generate_tripcode($name, $length = 10){ global $config; $name = stripslashes ( $name ); $t = explode('#', $name); -- cgit v1.3