Comment

Comment by samarudge

Having a quick read through the code (so I might have missed something) but the URL is generated from a substring of an SHA hash, does this not mean, at least in theory, URLs could be duplicated?

With a hex hash at 6 chars, there are a possible 16,777,216 unique URLs (Probably not an issue, unless you're bit.ly). But when there have been 1,677,721 URLs generated, there is a 10% chance a URL will be duplicated, at 8,388,608 there is a 50% chance, and so on. While those numbers are very high and probably not an issue, it's worth considering this probably wouldn't work on a large scale (Though I'm sure it wasn't designed too)

Not really a criticism, I still think this is a great example of how simple Node is, just an observation

parent samarudge 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton