PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
is slowww. It takes roughly a 10th of a second just to generate that. My page load times were under 5 thousandths of a second until i add that, then they jump up to .015 seconds. And.. well i want my page load times to look extremely cool
Is there a way to acheive the same affect using faster functions?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
So this appears to be MUCH faster. Should it still produce as random of a string as the first function?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
guess you edited your post, anyways its hard to say since you're truncating it to 10 characters anways... The idea isn't to have it random from what I infer from your code but to generate a unique string. If having sequential numbers isn't a problem that's how I'd go. If you want to increase entropy obviously don't truncate to the 10th character. It's still always possible to have a collision no matter what hashing function you are using so you will always need to have some kind of check. Just out of curiosity what is this being used for? A sessionID, a token in a form?
Last edited by josh on Sat Mar 04, 2006 6:48 pm, edited 1 time in total.
I switched that up and got roughly the same time, so I replaced uniqid(1) with microtime() and it reduced the time a lot
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.