summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-04-13 20:02:58 +1000
committerSavetheinternet <savetheinternet@n0v4.com>2011-04-13 20:02:58 +1000
commit7d736c102b956bf9dfaf3cb7bae0e8a130393801 (patch)
tree5067b1ea31b31e12498be5297bd386937b25cc67 /inc/functions.php
parentd57bbaf49619a8533b70e8c0019fd91f63da14ba (diff)
poster IDs
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php11
1 files changed, 9 insertions, 2 deletions
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);