zws-im / zws

Shorten URLs using invisible spaces

Home Page:https://zws.im

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Short ID generation can have duplicates

jonahsnider opened this issue · comments

Short IDs are generated partially using Node.js's Math.random(). This means that—although unlikely—the same short ID could be generated twice. This would cause users to be sent to the incorrect URL when they're redirected.

There should be a better system in place to generate short IDs to prevent this.

The rewrite of short ID generation (78b78fe) fixes this, as well as having even shorter URLs.