![]() |
Generate random key
I haven't figured out yet how to generate a random key that consists of letters and numbers. I managed to get it to generate numbers but for the life of me I can't seem to figure out how to generate a random alphanumeric key.
Here is what I am using for numeric only: PHP Code:
Any help greatly appreciated EDIT: Also, I have read quite a few articles on php.net but alas have come up empty handed. Thanks in advance Steve M |
This page should help you.
http://www.i-fubar.com/random-string-generator.php |
Is the link a joke? 2 lines are enough:
PHP Code:
|
Thanks MoT3rror and Hossie.
Hossie, what you gave me worked but it gave me a 16 letter string. I need it to be a mix of letters and numbers. |
So why don't you just use some hash algorithm?
PHP Code:
|
Perfect, thats what I was trying to figure out last night but couldn't. You just saved me a headache Hossie. Thanks.
That link above though seemed good but alot of lines of code. Glad you made a post. |
You must not have read the first part of the page.
PHP Code:
The second funtion. PHP Code:
Call on this to come with 16. PHP Code:
|
Using one of the hashing algorithms would be the most efficient solution - that is what hashing is for. :)
|
All times are GMT. The time now is 04:01 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|