Skip to content
Myr

README.zh-CN.md

This file

Path

README.zh-CN.md

397 lines · 12.5 KiB · Markdown

Last changed by

Reduce Nano ID size to 117 bytes (#613)Alexander Bayandinbefore adoption05057d8

History of this file

Take it

The walk stopped after 200 commits: lines older than cdc3edc point at it.

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 1–5why, one step back
1# Nano ID
23<img src="https://ai.github.io/nanoid/logo.svg" align="right"4 alt="Nano ID logo by Anton Lovchikov" width="180" height="94">5

docs: add Arabic README translation (#556)Mahmoud Hamdybefore adoptiondc629c5

line 6why, one step back
6[English](./README.md) | [日本語](./README.ja.md) | [Русский](./README.ru.md) | **简体中文** | [Bahasa Indonesia](./README.id-ID.md) | [한국어](./README.ko.md) | [العربية](./README.ar.md)

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 7–11why, one step back
7
8一个小巧、安全、URL友好、唯一的 JavaScript 字符串ID生成器。910> “一个惊人的无意义的完美主义水平,这简直让人无法不敬佩。”11

Reduce Nano ID size to 117 bytes (#613)Alexander Bayandinbefore adoption05057d8

line 12why, one step back
12- **小巧.** 117字节 (经过压缩和Brotli处理)。没有依赖。[Size Limit] 控制大小。

Port amazing nope-id optimizations (#602)Andrey Sitnikbefore adoptionb1bb75f

line 13why, one step back
13- **快速.** 比原生 `crypto.randomUUID()` 快 50%。

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 14–16why, one step back
14- **安全.** 它使用硬件随机生成器。可在集群中使用。
15- **紧凑.** 它使用比 UUID(`A-Za-z0-9_-`)更大的字母表。因此,ID 大小从36个符号减少到21个符号。16- **可移植.** Nano ID 已被移植到 [20种编程语言](#其他编程语言)。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 17–18why, one step back
17
18```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 19–20why, one step back
19import { nanoid } from "nanoid";
20model.id = nanoid(); //=> "V1StGXR8_Z5jdHi6B-myT"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 21–24why, one step back
21```
2223支持现代浏览器、IE [需使用 Babel]、Node.js 和 React Native。24

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 25why, one step back
25[Size Limit]: https://github.com/ai/size-limit

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 26–28why, one step back
26
27---28

Update EM bannerAndrey Sitnikbefore adoptionb49a237

line 29why, one step back
29<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Nano ID 由 <b><a href="https://evilmartians.com/">Evil Martians</a></b> 开发,我们是一家美国的设计与工程咨询公司,专注于<b>开发者工具、AI 和网络安全领域的初创公司</b>。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 30–42why, one step back
30
31---3233## 目录3435- [目录](#目录)36- [与 UUID 的比较](#与-uuid-的比较)37- [基准值](#基准值)38- [安全性](#安全性)39- [安装](#安装)40- [API](#api)41 - [自定义字母或大小](#自定义字母或大小)42 - [自定义随机字节生成器](#自定义随机字节生成器)

Update docsAndrey Sitnikbefore adoptionc0779bd

line 43why, one step back
43 - [不安全](#不安全)

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 44–48why, one step back
44- [用法](#用法)
45 - [React](#react)46 - [React Native](#react-native)47 - [PouchDB and CouchDB](#pouchdb-and-couchdb)48 - [CLI](#cli)

Clean up docsAndrey Sitnikbefore adoptionf7862cb

line 49why, one step back
49 - [TypeScript](#typescript)

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 50–65why, one step back
50 - [其他编程语言](#其他编程语言)
51- [工具](#工具)5253## 与 UUID 的比较5455Nano ID 与 UUID v4 (基于随机数) 相当。56它们在 ID 中有相似数量的随机位57(Nano ID 为126,UUID 为122),因此它们的碰撞概率相似::5859> 要想有十亿分之一的重复机会,60> 必须产生103万亿个版本4的ID.6162Nano ID 和 UUID v4之间有两个主要区别:63641. Nano ID 使用更大的字母表,所以类似数量的随机位65 被包装在21个符号中,而不是36个。

Port amazing nope-id optimizations (#602)Andrey Sitnikbefore adoptionb1bb75f

line 66why, one step back
662. Nano ID 比 `crypto.randomUUID` 和 `uuid/v4` 更快。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 67–71why, one step back
67
68## 基准值6970```rust71$ node ./test/benchmark.js

Port amazing nope-id optimizations (#602)Andrey Sitnikbefore adoptionb1bb75f

lines 72–82why, one step back
72nope-id 20,386,830 ops/sec
73nanoid 20,434,827 ops/sec74customAlphabet 20,544,476 ops/sec75crypto.randomUUID 12,865,759 ops/sec76uuid v4 7,930,104 ops/sec77@napi-rs/uuid 5,573,171 ops/sec78uid/secure 6,308,267 ops/sec79@lukeed/uuid 5,278,597 ops/sec80nanoid for browser 311,497 ops/sec81secure-random-string 301,667 ops/sec82uid-safe.sync 297,815 ops/sec

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 83–84why, one step back
83
84Non-secure:

Port amazing nope-id optimizations (#602)Andrey Sitnikbefore adoptionb1bb75f

lines 85–87why, one step back
85uid 20,286,757 ops/sec
86nanoid/non-secure 2,397,594 ops/sec87rndm 2,445,462 ops/sec

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 88–91why, one step back
88```
8990## 安全性91

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 92–93why, one step back
92_请看一篇关于随机生成器理论的好文章:
93[安全的随机值 (在 Node.js 中)]_

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 94why, one step back
94

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 95why, one step back
95- **不可预测性.** 不使用不安全的 `Math.random()`, Nano ID

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 96–97why, one step back
96 使用 Node.js 的 `crypto` 模块和浏览器的 Web Crypto API。
97 这些模块使用不可预测的硬件随机生成器。

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 98why, one step back
98- **统一性.** `random % alphabet` 是编写ID生成器时常犯的一个错误。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 99–104why, one step back
99 这样做会导致分布不均匀; 一些符号出现的机会较其他符号低。因此,在暴力破解时,尝试的次数会减少。
100 Nano ID 使用了一种 [更好的算法],并进行了一致性测试。101102 <img src="img/distribution.png" alt="Nano ID uniformity"103 width="340" height="135">104

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 105why, one step back
105- **有据可查:** 所有的 Nano ID 的行为都有记录。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 106why, one step back
106 见 [源代码] 中的注释。

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 107why, one step back
107- **漏洞:** 报告安全漏洞,请使用

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 108–111why, one step back
108 [安全联系人 Tidelift](https://tidelift.com/security).
109 Tidelift 将协调修复和披露。110111[安全的随机值 (在 Node.js 中)]: https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 112–113why, one step back
112[更好的算法]: https://github.com/ai/nanoid/blob/main/index.js
113[源代码]: https://github.com/ai/nanoid/blob/main/index.js

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 114–124why, one step back
114
115## 安装116117```bash118npm install nanoid119```120121想要快速上手尝试,你可以从 CDN 加载 Nano ID。但是,它不建议122在生产中使用,因为它的加载性能较低。123124```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 125why, one step back
125import { nanoid } from "https://cdn.jsdelivr.net/npm/nanoid/nanoid.js";

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 126–133why, one step back
126```
127128## API129130默认情况下,Nano ID 使用 URL 友好的符号(`A-Za-z0-9_-`)并返回一个131有21个字符(类似 UUID v4 的碰撞概率)的 ID。132133```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 134–135why, one step back
134import { nanoid } from "nanoid";
135model.id = nanoid(); //=> "V1StGXR8_Z5jdHi6B-myT"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 136–141why, one step back
136```
137138如果你想要减小 ID 大小(但是会增加碰撞概率),139可以将大小作为参数传递140141```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 142why, one step back
142nanoid(10); //=> "IRFa-VaY2b"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 143–149why, one step back
143```
144145别忘了在我们的 [ID 碰撞概率] 计算器中检查你的 ID 大小的安全性。146147您也可以使用 [自定义字母表](#自定义字母或大小)148或者是 [自定义生成器](#自定义随机字节生成器).149

Update collision calculator URL in all README translations (#568)Mahmoud Hamdybefore adoptiond8fba79

line 150why, one step back
150[ID 碰撞概率]: https://zelark.github.io/nano-id-cc/

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 151–156why, one step back
151
152### 自定义字母或大小153154`customAlphabet` 返回一个函数,允许您使用自定义字母表和ID大小创建 `nanoid`。155156```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 157–159why, one step back
157import { customAlphabet } from "nanoid";
158const nanoid = customAlphabet("1234567890abcdef", 10);159model.id = nanoid(); //=> "4f90d13a42"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 160–162why, one step back
160```
161162```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 163–165why, one step back
163import { customAlphabet } from "nanoid/non-secure";
164const nanoid = customAlphabet("1234567890abcdef", 10);165user.id = nanoid();

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 166–176why, one step back
166```
167168在我们的 [ID 碰撞概率] 计算器中检查您的自定义字母表和 ID 大小的安全性。169查看 [`nanoid-dictionary`] 中的选项以获取更多字母表。170171字母表必须包含256个或更少的符号。172否则,无法保证内部生成器算法的安全性。173174除了设置默认大小外,您还可以在调用函数时更改ID大小:175176```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 177–179why, one step back
177import { customAlphabet } from "nanoid";
178const nanoid = customAlphabet("1234567890abcdef", 10);179model.id = nanoid(5); //=> "f01a2"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 180–181why, one step back
180```
181

Update collision calculator URL in all README translations (#568)Mahmoud Hamdybefore adoptiond8fba79

line 182why, one step back
182[ID collision probability]: https://zelark.github.io/nano-id-cc/

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 183why, one step back
183[`nanoid-dictionary`]: https://github.com/CyberAP/nanoid-dictionary

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 184–192why, one step back
184
185### 自定义随机字节生成器186187`customRandom` 允许您创建一个 `nanoid` 并替换字母表188和默认的随机字节生成器。189190在此示例中,使用基于种子的生成器:191192```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 193why, one step back
193import { customRandom } from "nanoid";

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 194why, one step back
194

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 195–198why, one step back
195const rng = seedrandom(seed);
196const nanoid = customRandom("abcdef", 10, (size) => {197 return new Uint8Array(size).map(() => 256 * rng());198});

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 199why, one step back
199

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 200why, one step back
200nanoid(); //=> "fbaefaadeb"

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 201–208why, one step back
201```
202203`random` 回调必须接受数组大小并返回随机数的数组。204205如果要使用与 `customRandom` 相同的URL友好符号,206您可以使用 `urlAlphabet` 获取默认字母表。207208```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 209–210why, one step back
209const { customRandom, urlAlphabet } = require("nanoid");
210const nanoid = customRandom(urlAlphabet, 10, random);

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 211–213why, one step back
211```
212213请注意,在Nano ID的不同版本之间,我们可能会更改随机生成器的调用顺序。如果您正在使用基于种子的生成器,我们不能保证相同的结果。

Update docsAndrey Sitnikbefore adoptionc0779bd

lines 214–219why, one step back
214
215### 不安全216217Nano ID 使用硬件随机字节生成以提供安全性和较低的碰撞概率。如果您对安全性不太担心,您可以在没有硬件随机生成器的环境中使用它218219```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 220–221why, one step back
220import { nanoid } from "nanoid/non-secure";
221const id = nanoid(); //=> "Uakgb_J5m9g-0JDMbcJqLJ"

Update docsAndrey Sitnikbefore adoptionc0779bd

lines 222–224why, one step back
222```
223224请注意,非安全版本比安全版本*更慢*,请仅在必要时使用。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 225–233why, one step back
225
226## 用法227228### React229230目前还没有将 nanoid 用于 React `key` prop 的正确方法231因为它在不同的渲染中应该是一致的。232233```jsx

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 234why, one step back
234function Todos({ todos }) {

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 235–236why, one step back
235 return (
236 <ul>

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 237why, one step back
237 {todos.map((todo) => (

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 238why, one step back
238 <li key={nanoid()}>

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 239why, one step back
239 {" "}

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 240why, one step back
240 /* 不要这样做 */

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 241–244why, one step back
241 {todo.text}
242 </li>243 ))}244 </ul>

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 245why, one step back
245 );

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 246–251why, one step back
246}
247```248249您应该尝试在列表项中找到稳定的 id。250251```jsx

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 252why, one step back
252const todoItems = todos.map((todo) => <li key={todo.id}>{todo.text}</li>);

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 253–257why, one step back
253```
254255如果您没有稳定的 ID,您最好使用索引作为 `键` 而不是 `nanoid()`:256257```jsx

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 258–259why, one step back
258const todoItems = todos.map((text, index) => (
259 <li key={index}>

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 260why, one step back
260 {" "}

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 261why, one step back
261 /* 仍然不推荐,但优于 nanoid()。 仅当项目没有稳定ID时才执行此操作。 */

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 262–263why, one step back
262 {text}
263 </li>

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 264why, one step back
264));

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 265–268why, one step back
265```
266267如果您只需要随机 ID 来将元素(如标签和输入字段)链接在一起,建议使用 [`useId`]。该钩子在 React 18 中添加。268

Fix outdated size and links in README translations (#570)Mahmoud Hamdybefore adoption0232bae

line 269why, one step back
269[`useId`]: https://react.dev/reference/react/useId

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 270–278why, one step back
270
271### React Native272273React Native 没有内置的随机生成器。以下polyfill适用于纯 React Native 和 Expo,从39.x版本开始生效。2742751. 检查 [`react-native-get-random-values`] 文档并安装它。2762. 在 Nano ID 之前导入它。277278```js

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 279–280why, one step back
279import "react-native-get-random-values";
280import { nanoid } from "nanoid";

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 281–324why, one step back
281```
282283[`react-native-get-random-values`]: https://github.com/LinusU/react-native-get-random-values284285### PouchDB and CouchDB286287在 PouchDB 和 CouchDB 中,ID 不能以下划线 `_` 开头。288需要一个前缀来防止这个问题,因为 Nano ID 可能在默认情况下使用 `_` 作为 ID 的开头。289在默认情况下,在 ID 的开头使用 `_`。290291用下面的选项覆盖默认的 ID。292293```js294db.put({295 _id: 'id' + nanoid(),296 …297})298```299300### CLI301302你可以通过调用 `npx nanoid` 在终端获得唯一的 ID。你只需要303在系统中安装了 Node.js。你不需要把 Nano ID 安装在任何地方。304305```sh306$ npx nanoid307npx: installed 1 in 0.63s308LZfXLFzPPR4NNrgjlWDxn309```310311生成的ID的大小可以使用 `--size`(或 `-s` )选项指定:312313```sh314$ npx nanoid --size 10315L3til0JS4z316```317318可以使用 `--alphabet`(或 `-a` )选项指定自定义字母表(请注意,这种情况下需要 `--size` 选项)。319320```sh321$ npx nanoid --alphabet abc --size 15322bccbcabaabaccab323```324

Make functions generic so it can cast to opaque (branded) types (#521)Sasha Kossbefore adoptionea64dc7

lines 325–329why, one step back
325### TypeScript
326327Nano ID 允许将生成的字符串转换为 TypeScript 中的不透明字符串。 例如:328329```ts

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 330–331why, one step back
330declare const userIdBrand: unique symbol;
331type UserId = string & { [userIdBrand]: true };

Make functions generic so it can cast to opaque (branded) types (#521)Sasha Kossbefore adoptionea64dc7

line 332why, one step back
332

Clean up docsAndrey Sitnikbefore adoptionf7862cb

line 333why, one step back
333// 使用显式类型参数:

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

line 334why, one step back
334mockUser(nanoid<UserId>());

Clean up docsAndrey Sitnikbefore adoptionf7862cb

line 335why, one step back
335

Make functions generic so it can cast to opaque (branded) types (#521)Sasha Kossbefore adoptionea64dc7

line 336why, one step back
336interface User {

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 337–338why, one step back
337 id: UserId;
338 name: string;

Make functions generic so it can cast to opaque (branded) types (#521)Sasha Kossbefore adoptionea64dc7

lines 339–343why, one step back
339}
340341const user: User = {342 // 自动转换为 UserId:343 id: nanoid(),

Reduce dependencies by moving to Rolldown instead of Webpack for Size LimitAndrey Sitnikbefore adoptionb8918c5

lines 344–345why, one step back
344 name: "Alice",
345};

Make functions generic so it can cast to opaque (branded) types (#521)Sasha Kossbefore adoptionea64dc7

line 346why, one step back
346```

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 347–351why, one step back
347
348### 其他编程语言349350Nano ID 已被移植到许多语言。 你可以使用下面这些移植,获取在客户端和服务器端相同的ID生成器。351

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 352–371why, one step back
352- [C#](https://github.com/codeyu/nanoid-net)
353- [C++](https://github.com/mcmikecreations/nanoid_cpp)354- [Clojure and ClojureScript](https://github.com/zelark/nano-id)355- [ColdFusion/CFML](https://github.com/JamoCA/cfml-nanoid)356- [Crystal](https://github.com/mamantoha/nanoid.cr)357- [Dart & Flutter](https://github.com/pd4d10/nanoid-dart)358- [Deno](https://github.com/ianfabs/nanoid)359- [Elixir](https://github.com/railsmechanic/nanoid)360- [Gleam](https://github.com/0xca551e/glanoid)361- [Go](https://github.com/jaevor/go-nanoid)362- [Haskell](https://github.com/MichelBoucey/NanoID)363- [Haxe](https://github.com/flashultra/uuid)364- [Janet](https://sr.ht/~statianzo/janet-nanoid/)365- [Java](https://github.com/wosherco/jnanoid-enhanced)366- [Kotlin](https://github.com/viascom/nanoid-kotlin)367- [MySQL/MariaDB](https://github.com/viascom/nanoid-mysql-mariadb)368- [Nim](https://github.com/icyphox/nanoid.nim)369- [Perl](https://github.com/tkzwtks/Nanoid-perl)370- [PHP](https://github.com/hidehalo/nanoid-php)371- [Python](https://github.com/puyuan/py-nanoid)

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 372why, one step back
372 with [dictionaries](https://pypi.org/project/nanoid-dictionary)

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 373–381why, one step back
373- [Postgres Extension](https://github.com/spa5k/uids-postgres)
374- [Postgres Native Function](https://github.com/viascom/nanoid-postgres)375- [R](https://github.com/hrbrmstr/nanoid) (with dictionaries)376- [Ruby](https://github.com/radeno/nanoid.rb)377- [Rust](https://github.com/nikolay-govorov/nanoid)378- [Swift](https://github.com/ShivaHuang/swift-nanoid)379- [Unison](https://share.unison-lang.org/latest/namespaces/hojberg/nanoid)380- [V](https://github.com/invipal/nanoid)381- [Zig](https://github.com/SasLuca/zig-nanoid)

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 382–388why, one step back
382
383此外,[CLI] 还可用于从命令行生成 ID。384385[CLI]: #cli386387## 工具388

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 389why, one step back
389- [ID size 计算器] 显示调整时的碰撞概率

Update size limitAndrey Sitnikbefore adoptioncdc3edc

line 390why, one step back
390 ID的字母或大小。

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 391–392why, one step back
391- [`nanoid-dictionary`] 与常用的字母一起使用 [`自定义字母`]。
392- [`nanoid-good`] 以确保你的ID不包含任何淫秽词汇。

Update size limitAndrey Sitnikbefore adoptioncdc3edc

lines 393–394why, one step back
393
394[`nanoid-dictionary`]: https://github.com/CyberAP/nanoid-dictionary

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 395–397why, one step back
395[ID size 计算器]: https://zelark.github.io/nano-id-cc/
396[`自定义字母`]: #自定义字母或大小397[`nanoid-good`]: https://github.com/y-gagar1n/nanoid-good