Skip to content

Comment on Ask HN: How should I create a unique id for entries that aren't incremental?

Comments

Incremental IDs work best, but if you want you can hash a UUID which will work for your use case:

% uuidgen

B14818B6-4219-43BD-82EF-8421EC1AFBCF

% echo "B14818B6-4219-43BD-82EF-8421EC1AFBCF" | shasum -a 256

00ea501d47789ac5eb559f10d631b3f6df8f82b5cba9c1f9d234b705d89f1704

Those urls are kind of ugly. If this helps at all, maybe I could create a public url id based off the incremental PK id's.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.