提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.6 KiB

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
  1. # Nano ID
  2. <img src="https://ai.github.io/nanoid/logo.svg" align="right"
  3. alt="Nano ID logo by Anton Lovchikov" width="180" height="94">
  4. **English** | [日本語](./README.ja.md) | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) | [한국어](./README.ko.md)
  5. A tiny, secure, URL-friendly, unique string ID generator for JavaScript.
  6. > “An amazing level of senseless perfectionism,
  7. > which is simply impossible not to respect.”
  8. * **Small.** 118 bytes (minified and brotlied). No dependencies.
  9. [Size Limit] controls the size.
  10. * **Safe.** It uses hardware random generator. Can be used in clusters.
  11. * **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`).
  12. So ID size was reduced from 36 to 21 symbols.
  13. * **Portable.** Nano ID was ported
  14. to over [20 programming languages](./README.md#other-programming-languages).
  15. ```js
  16. import { nanoid } from 'nanoid'
  17. model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
  18. ```
  19. ---
  20. <img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made at <b><a href="https://evilmartians.com/devtools?utm_source=nanoid&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
  21. ---
  22. [online tool]: https://gitpod.io/#https://github.com/ai/nanoid/
  23. [with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/
  24. [Size Limit]: https://github.com/ai/size-limit
  25. ## Docs
  26. Read full docs **[here](https://github.com/ai/nanoid#readme)**.