| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Random Passwords Got a tad bored today, so wrote a function for random passwords. Maybe it will help someone. PHP Code: |
| | |
| | #2 (permalink) |
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: Added MiXeD case option Fixed the length ($i = 0; $i <=$numchars) part.
__________________
Last edited by Danltn; 11-03-2007 at 01:36 PM.
|
| | |
| | #3 (permalink) |
| Senior Member Join Date: Aug 2005 Location: East Yorkshire, England
Posts: 2,689
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Both good, but heres a function I made a while ago and have been using, it may not be as customizable, but the passwords are very difficult to guess: PHP Code: |
| | |
| | #4 (permalink) |
| New Member Join Date: Feb 2008
Posts: 9
![]() | i had to go for the smallest one ![]() PHP Code: creates random string of A–Z, a–z, and 0–9 of max of 42ish chars |
| | |
| | #5 (permalink) | ||||
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ | ||||
| | |
| | #6 (permalink) | ||||||||
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Dan
__________________ | ||||||||
| | |
| | #7 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | If you know exactly what second after Unix Epoch they made that password, then yes... you could guess it... ????: NamePros.com http://www.namepros.com/showthread.php?t=391711 Unless we add a little bit of salt ![]() PHP Code:
Last edited by mholt; 07-10-2008 at 09:49 PM.
|
| | |
| | #8 (permalink) |
| New Member Join Date: Dec 2008
Posts: 3
![]() | This is what I've been using for any random string PHP Code: PHP Code:
Last edited by Cavemaneca; 12-12-2008 at 07:07 PM.
|
| | |
| | #9 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,556
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I use this: PHP Code: |
| | |
| | #10 (permalink) |
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: ~ And @Cavemaneca (bool) $sp = 'false' evals to TRUE, not FALSE. Just be careful with this, as it can definitely fall into unexpected behaviour (although it's not really all that 'unexpected'. PHP Code:
__________________ |
| | |