TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Free PHP URL shortener script that can shorten over 4 billion URLs

2 点作者 briancray超过 15 年前

2 条评论

wooby超过 15 年前
Hi, looks like it was a fun project. While you save yourself from checking the DB for a duplicate hash with your hex id strategy, a side effect of this technique is that every URL created with your service is effectively public. For instance, I could start at <a href="http://briancray.com/tests/shorturl/0" rel="nofollow">http://briancray.com/tests/shorturl/0</a> and work my way up through every URL ever shortened by incrementing the id in hex. Whether this is a vulnerability or undocumented feature is up to you to decide :)<p>I bring it up because I ran across the same issue with my own site, droplink.me. It was a more serious problem for me, because user uploaded files are supposed to be private. I went with randomly generated URLs.
评论 #788969 未加载
growt超过 15 年前
the urls could be much shorter if you used a-z and A-Z and not just hex (a-f). But it saves some lines of code.