l_l
17 years ago
I'd like to apologize to everyones links I just deleted (your going to have to reenter that one hans, just wait a sec). It needed to be done
latest #34
l_l
17 years ago
Stupid PHP...Its going from - to gb. How does that make sense? I'm taking it down till I figure this out.
Hans
17 years ago
gb? You mean onehalf.ws/gb ?
l_l
17 years ago
Yah. Can you take a look at the code? I've got to eat dinner.
立即下載
Hans
17 years ago
Sure, just paste it to pastie.org
Hans
17 years ago
(they're working again! yay!)
l_l
17 years ago
It did work (it went from ka to kb, as it should), but after deleting all the previous slugs, it now goes to gb.
Hans
17 years ago
And you're saying that there are no rows in that table?
Hans
17 years ago
When you get back - what did you change since last time? Why not just revert how you were doing it before?
l_l
17 years ago
No, there are rows in the table. Right now, its up to _, and that should progress to -
l_l
17 years ago
The reason I didn't keep it the was it was is because I would have gotten only 130 URL's, when I should have gotten 4225
Hans
17 years ago
Hm, just to test, what happens if you remove 'g' from the $alphabet array? Does it return 'fb' or 'hb'?
Hans
17 years ago
What do you mean, you'd have only gotten 130 URLs? It says in the script there're nearly 17 million possibilities.
l_l
17 years ago
You can ignore that. I never deleted the old comments.
l_l
17 years ago
Hmm...Now it says the previous slug is ga...How wierd.
Hans
17 years ago
After you removed 'g' from the alphabet?
Hans
17 years ago
Do you have an IM account that we can talk on?
l_l
17 years ago
Found it. It was buried a page back. Working like it did before, not how I want.
Hans
17 years ago
How can there only be 130 possibilities? (26+26+10+2)*(26+26+10+2) = 4096
l_l
17 years ago
it was going from aa to -a, then -a to -- So, 65 +65 = 130
Hans
17 years ago
Why not 65 * 65?
l_l
17 years ago
Because it was going from aa - ba ... _a -a = 65 possiblilities.
Hans
17 years ago
Man, I wish there was some open-source URL shortening service
Hans
17 years ago
It would be much easier to see how they do it.
l_l
17 years ago
There is, it sucks.
l_l
17 years ago
It uses MD5 hashes of urls to create the suffixes.
Chris
17 years ago
Well, the code wasn't exactly made for what you're trying to do. x_x
Hans
17 years ago
AHA! I know! I know! I just read on how to do it. Use base36 or base31: pastie.org/233392
Hans
17 years ago
Just grab the row's ID and convert to base31
Hans
17 years ago
and.. voila! A good, unique ID
Chris
17 years ago
But the idea is to have it increment, though. Unique IDs aren't the issue.
Hans
17 years ago
If I read it correctly, it still will increment
Hans
17 years ago
We could just try that, see if it works.
Hans
17 years ago
Yes, it does increment - you can see it working on foo9.net. Here's the blog post about it:clickontyler.com/blog/20...
back to top