![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,328
|
best way to generate a random string?
looking to create a string like on pastebin for the entries.
whats the best way to go about this? current way im doing is using uniqid with some other jazz Code:
function short_name( $post_name ) { global $wpdb, $post; if ( !is_object( $post ) ) return $post_name; $num = (int) $post->ID; $pasteid = md5(uniqid($num, true)); $slug = dechex(crc32($pasteid)); return $slug; }
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
nothign wrong with md5(uniqid());
You can maybe use microtime too
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
CjOverkill
Industry Role:
Join Date: Apr 2003
Location: Woldwide
Posts: 1,328
|
Compile your apache with mod unique_id and let the web server care about it for you.
On high traffic servers the performance impact is almost nothing. Your solution is considerably slower than apache inique_id and will consume quite more CPU. Other than that, it's an ok solution.
__________________
CjOverkill Traffic Trading Script Free, secure and fast traffic trading script. Get your copy now ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,328
|
Quote:
I thik i have that module installed for expiring links.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
or you can just take a sessionid
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |