ai/nanoid
View on GitHub ↗ ★ 27,120 JavaScript
A tiny (118 bytes), secure, URL-friendly, unique string ID generator for JavaScript
19 mentions on Hacker News by 19 people: 1 story, 18 comments · first 2017-09-12 · latest 2026-05-19
20082026
-
just nanoid(5) https://github.com/ai/nanoid
comment by diimdeep · 2026-05-19 · in Show HN: Id-agent – Token efficient UUID alternative for AI agents -
I vote for [nanoid]( https://github.com/ai/nanoid ).
comment by busymom0 · 2025-11-09 · in I Am Mark Zuckerberg -
Nanoid? https://github.com/ai/nanoid
comment by candiddevmike · 2024-08-26 · in TIL: Versions of UUID and when to use them -
I usually go for Nano Id for new projects https://github.com/ai/nanoid
comment by erlendellingsen · 2023-09-11 · in You Don't Need UUID -
I’ve started using nanoid for generated ids. Here is the JavaScript version: https://github.com/ai/nanoid Some info from that page: - Safe. It uses hardware random generator. Can be used in clusters. - Short IDs. It uses a larger alphabet…
comment by dugmartin · 2023-06-23 · in Analyzing New Unique Identifier Formats (UUIDv6, UUIDv7, and UUIDv8) (2022) -
…its block size (and record size, if you use ZFS). Good luck! [0]: https://github.com/ulid/spec [1]: https://github.com/ai/nanoid/blob/main/async/index.js#L5 [2]: https://github.com/nodejs/node/blob/main/doc/api/crypto.md#c... [3]:…
comment by sgarland · 2023-02-09 · in Launch HN: Activepieces (YC S22) – Open-Source Zapier Alternative -
…composable!) It looks like NanoIDs are entirely random values reduced to a specific alphabet ( https://github.com/ai/nanoid/blob/main/index.js ) -- which is approximately similar to: tr -dc _A-Z-a-z-0-9 < /dev/urandom | tr -d…
comment by thaumaturgy · 2022-12-30 · in We chose NanoIDs for PlanetScale’s API -
Just look out for this issue: https://github.com/ai/nanoid/issues/365
comment by andrewstuart · 2022-12-29 · in We chose NanoIDs for PlanetScale’s API -
Can someone clarify this statement from the original nanoID site ( https://github.com/ai/nanoid ) for me? "random % alphabet is a popular mistake to make when coding an ID generator. The distribution will not be even; there will be a lower…
comment by hangonhn · 2022-12-29 · in We chose NanoIDs for PlanetScale’s API -
I really like https://github.com/ai/nanoid which is available for a wide range of programming languages. It creates short, random, and URL-safe IDs.
comment by cryptos · 2022-11-22 · in Moving Away from UUIDs (2018) -
Some UUID alternatives: - https://github.com/ai/nanoid - https://github.com/segmentio/ksuid - https://github.com/ulid/spec
comment by gcoguiec · 2022-11-22 · in Moving Away from UUIDs (2018) -
…using Node.js, then remember how many things I miss from JS when trialing another language. [1]: https://github.com/ai/nanoid/issues/365
comment by marcus_cemes · 2022-09-29 · in ReScript 10.0 -
…stores some more obfuscated representation of the primary key and index it separately. Yep, see: https://github.com/ai/nanoid and https://hashids.org/
comment by ignoramous · 2021-02-23 · in Things you should do now (2011) -
…it gives makes it easy to generate appropriate visible ids. Simple, fast, small and works well. (1) https://github.com/ai/nanoid
comment by astatine · 2020-12-04 · in Pg-shortkey: YouTube-Like Short IDs as Postgres Primary Keys -
…has a variant that will check for rude words, in case the identifier is particularly user-visible. https://github.com/ai/nanoid It has a nice calculator for collision probability as well.
comment by tdeck · 2020-12-01 · in Ask HN: IDs that are URL-friendly and fairly short? -
If hyperid performs better then why is nonoid ( https://github.com/ai/nanoid ) more popular
comment by niksmac · 2020-10-12 · in Uber-fast unique id generation, for Node.js and the browser 14,452,901 ops/SEC -
…rather than on encoding metadata and sortability, I feel I've finally found what will work well: https://github.com/ai/nanoid And others seem to agree (though unimportantly on a different platform): https://www.npmtrends.com/nanoid-vs-short…
comment by mitchtbaum · 2019-02-04 · in A brief history of the UUID (2017) -
▲ 78
Nano ID: A tiny, secure URL-friendly unique string ID generator for JavaScriptstory by iskin · 2017-09-12 · 78 comments