Hacker GitHub

← All repos

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

Mentions per year 19 mentions · busiest year 2022 (6)
20082026
  1. just nanoid(5) https://github.com/ai/nanoid
  2. I vote for [nanoid]( https://github.com/ai/nanoid ).
    comment by busymom0 · 2025-11-09 · in I Am Mark Zuckerberg
  3. Nanoid? https://github.com/ai/nanoid
    comment by candiddevmike · 2024-08-26 · in TIL: Versions of UUID and when to use them
  4. No thread about UUID is complete without a plug for NanoID! https://github.com/ai/nanoid/blob/main/README.md
    comment by zukzuk · 2024-02-05 · in UUID v7
  5. 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
  6. 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…
  7. …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]:…
  8. …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
  9. 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
  10. 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
  11. 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)
  12. 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)
  13. …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
  14. …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)
  15. …it gives makes it easy to generate appropriate visible ids. Simple, fast, small and works well. (1) https://github.com/ai/nanoid
  16. …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.
  17. If hyperid performs better then why is nonoid ( https://github.com/ai/nanoid ) more popular
  18. …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)