Skip to content
Myr

README.md

This file

Path

README.md

484 lines · 14.2 KiB · Markdown

Last changed by

TypoAndrey Sitnikbefore adoption4eab463

History of this file

Take it

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

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

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.ja.md) | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) | [한국어](./README.ko.md) | [العربية](./README.ar.md)

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 7–12why, one step back
7
8A tiny, secure, URL-friendly, unique string ID generator for JavaScript.910> “An amazing level of senseless perfectionism,11> which is simply impossible not to respect.”12

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 13why, one step back
13- **Small.** 118 bytes (minified and brotlied). No dependencies.

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 14why, one step back
14 [Size Limit] controls the size.

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 15–16why, one step back
15- **Safe.** It uses hardware random generator. Can be used in clusters.
16- **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`).

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 17why, one step back
17 So ID size was reduced from 36 to 21 symbols.

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 18why, one step back
18- **Portable.** Nano ID was ported

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 19–27why, one step back
19 to over [20 programming languages](./README.md#other-programming-languages).
2021```js22import { nanoid } from 'nanoid'23model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"24```2526---27

TypoAndrey Sitnikbefore adoption3e281cc

line 28why, one step back
28<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>.

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 29–32why, one step back
29
30---3132[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 33–34why, one step back
33[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/
34[Size Limit]: https://github.com/ai/size-limit

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 35–37why, one step back
35
36## Table of Contents37

Add Node.js 22 recommendationAndrey Sitnikbefore adoptiona3d7dc5

lines 38–42why, one step back
38- [Table of Contents](#table-of-contents)
39- [Comparison with UUID](#comparison-with-uuid)40- [Benchmark](#benchmark)41- [Security](#security)42- [Install](#install)

Clean up docsAndrey Sitnikbefore adoption90bb934

lines 43–44why, one step back
43 - [ESM](#esm)
44 - [CommonJS](#commonjs)

Add JSR docsAndrey Sitnikbefore adoption6ed8f57

line 45why, one step back
45 - [JSR](#jsr)

Clean up docsAndrey Sitnikbefore adoption90bb934

line 46why, one step back
46 - [CDN](#cdn)

Add Node.js 22 recommendationAndrey Sitnikbefore adoptiona3d7dc5

lines 47–56why, one step back
47- [API](#api)
48 - [Blocking](#blocking)49 - [Non-Secure](#non-secure)50 - [Custom Alphabet or Size](#custom-alphabet-or-size)51 - [Custom Random Bytes Generator](#custom-random-bytes-generator)52- [Usage](#usage)53 - [React](#react)54 - [React Native](#react-native)55 - [PouchDB and CouchDB](#pouchdb-and-couchdb)56 - [CLI](#cli)

Clean up docsAndrey Sitnikbefore adoptionf7862cb

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

Add Node.js 22 recommendationAndrey Sitnikbefore adoptiona3d7dc5

lines 58–59why, one step back
58 - [Other Programming Languages](#other-programming-languages)
59- [Tools](#tools)

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 60–74why, one step back
60
61## Comparison with UUID6263Nano ID is quite comparable to UUID v4 (random-based).64It has a similar number of random bits in the ID65(126 in Nano ID and 122 in UUID), so it has a similar collision probability:6667> For there to be a one in a billion chance of duplication,68> 103 trillion version 4 IDs must be generated.6970There are two main differences between Nano ID and UUID v4:71721. Nano ID uses a bigger alphabet, so a similar number of random bits73 are packed in just 21 symbols instead of 36.742. Nano ID code is **4 times smaller** than `uuid/v4` package:

Fix outdated info and links in README (#566)Mahmoud Hamdybefore adoptionc7ca9e9

line 75why, one step back
75 118 bytes instead of 423.

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 76–80why, one step back
76
77## Benchmark7879```rust80$ node ./test/benchmark.js

Update nope-id for benchmark (#593)Andrey Sitnikbefore adoption78f4a02

lines 81–91why, one step back
81nope-id 27,398,074 ops/sec
82crypto.randomUUID 14,055,107 ops/sec83uuid v4 9,256,301 ops/sec84@napi-rs/uuid 7,100,180 ops/sec85uid/secure 7,312,765 ops/sec86@lukeed/uuid 5,543,254 ops/sec87nanoid 4,954,561 ops/sec88customAlphabet 6,708,339 ops/sec89nanoid for browser 497,980 ops/sec90secure-random-string 412,049 ops/sec91uid-safe.sync 420,669 ops/sec

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 92–93why, one step back
92
93Non-secure:

Update nope-id for benchmark (#593)Andrey Sitnikbefore adoption78f4a02

lines 94–96why, one step back
94uid 27,106,859 ops/sec
95nanoid/non-secure 2,672,540 ops/sec96rndm 2,666,518 ops/sec

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 97–98why, one step back
97```
98

Update benchmarkAndrey Sitnikbefore adoption25bbffb

line 99why, one step back
99Test configuration: Framework 13 7840U, Fedora 39, Node.js 21.6.

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 100–102why, one step back
100
101## Security102

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 103–104why, one step back
103_See a good article about random generators theory:
104[Secure random values (in Node.js)]_

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 105why, one step back
105

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 106why, one step back
106- **Unpredictability.** Instead of using the unsafe `Math.random()`, Nano ID

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 107–108why, one step back
107 uses the `crypto` module in Node.js and the Web Crypto API in browsers.
108 These modules use unpredictable hardware random generator.

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 109why, one step back
109- **Uniformity.** `random % alphabet` is a popular mistake to make when coding

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 110–117why, one step back
110 an ID generator. The distribution will not be even; there will be a lower
111 chance for some symbols to appear compared to others. So, it will reduce112 the number of tries when brute-forcing. Nano ID uses a [better algorithm]113 and is tested for uniformity.114115 <img src="img/distribution.png" alt="Nano ID uniformity"116 width="340" height="135">117

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 118why, one step back
118- **Well-documented:** all Nano ID hacks are documented. See comments

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 119why, one step back
119 in [the source].

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 120why, one step back
120- **Vulnerabilities:** to report a security vulnerability, please use

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 121–124why, one step back
121 the [Tidelift security contact](https://tidelift.com/security).
122 Tidelift will coordinate the fix and disclosure.123124[Secure random values (in Node.js)]: https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 125–126why, one step back
125[better algorithm]: https://github.com/ai/nanoid/blob/main/index.js
126[the source]: https://github.com/ai/nanoid/blob/main/index.js

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 127–129why, one step back
127
128## Install129

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

line 130why, one step back
130### ESM

Clean up docsAndrey Sitnikbefore adoption90bb934

line 131why, one step back
131

Fix Install guideAndrey Sitnikbefore adoptiona456c40

line 132why, one step back
132Nano ID 5 works with ESM projects (with `import`) in tests or Node.js scripts.

Add Node.js 22 recommendationAndrey Sitnikbefore adoptiona3d7dc5

line 133why, one step back
133

Clean up docsAndrey Sitnikbefore adoption90bb934

lines 134–135why, one step back
134```bash
135npm install nanoid

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 136–137why, one step back
136```
137

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

lines 138–139why, one step back
138### CommonJS
139

Clean up docsAndrey Sitnikbefore adoption90bb934

line 140why, one step back
140Nano ID can be used with CommonJS in one of the following ways:

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

line 141why, one step back
141

Clean up docsAndrey Sitnikbefore adoption90bb934

lines 142–147why, one step back
142- You can use `require()` to import Nano ID. You need to use latest Node.js
143 22.12 (works out-of-the-box) or Node.js 20144 (with `--experimental-require-module`).145146- For Node.js 18 you can dynamically import Nano ID as follows:147

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

line 148why, one step back
148 ```js

Clean up docsAndrey Sitnikbefore adoption90bb934

line 149why, one step back
149 let nanoid

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

line 150why, one step back
150 module.exports.createID = async () => {

Clean up docsAndrey Sitnikbefore adoption90bb934

lines 151–152why, one step back
151 if (!nanoid) ({ nanoid } = await import('nanoid'))
152 return nanoid() // => "V1StGXR8_Z5jdHi6B-myT"

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

lines 153–156why, one step back
153 }
154 ```155156- You can use Nano ID 3.x (we still support it):

Clean up docsAndrey Sitnikbefore adoption90bb934

line 157why, one step back
157

Add instructions for dynamic import in README.md (#516)YitzchakMeltzbefore adoption5681219

lines 158–160why, one step back
158 ```bash
159 npm install nanoid@3160 ```

Add JSR docsAndrey Sitnikbefore adoption6ed8f57

lines 161–180why, one step back
161
162### JSR163164[JSR](https://jsr.io) is a replacement for npm with open governance165and active development (in contrast to npm).166167```bash168npx jsr add @sitnik/nanoid169```170171You can use it in Node.js, Deno, Bun, etc.172173```js174// Replace `nanoid` to `@sitnik/nanoid` in all imports175import { nanoid } from '@sitnik/nanoid'176```177178For Deno install it by `deno add jsr:@sitnik/nanoid` or import179from `jsr:@sitnik/nanoid`.180

Clean up docsAndrey Sitnikbefore adoption90bb934

lines 181–188why, one step back
181### CDN
182183For quick hacks, you can load Nano ID from CDN. Though, it is not recommended184to be used in production because of the lower loading performance.185186```js187import { nanoid } from 'https://cdn.jsdelivr.net/npm/nanoid/nanoid.js'188```

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 189–267why, one step back
189
190## API191192Nano ID has 2 APIs: normal and non-secure.193194By default, Nano ID uses URL-friendly symbols (`A-Za-z0-9_-`) and returns an ID195with 21 characters (to have a collision probability similar to UUID v4).196197### Blocking198199The safe and easiest way to use Nano ID.200201In rare cases could block CPU from other work while noise collection202for hardware random generator.203204```js205import { nanoid } from 'nanoid'206model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"207```208209If you want to reduce the ID size (and increase collisions probability),210you can pass the size as an argument.211212```js213nanoid(10) //=> "IRFa-VaY2b"214```215216Don’t forget to check the safety of your ID size217in our [ID collision probability] calculator.218219You can also use a [custom alphabet](#custom-alphabet-or-size)220or a [random generator](#custom-random-bytes-generator).221222[ID collision probability]: https://zelark.github.io/nano-id-cc/223224### Non-Secure225226By default, Nano ID uses hardware random bytes generation for security227and low collision probability. If you are not so concerned with security,228you can use it for environments without hardware random generators.229230```js231import { nanoid } from 'nanoid/non-secure'232const id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqLJ"233```234235### Custom Alphabet or Size236237`customAlphabet` returns a function that allows you to create `nanoid`238with your own alphabet and ID size.239240```js241import { customAlphabet } from 'nanoid'242const nanoid = customAlphabet('1234567890abcdef', 10)243model.id = nanoid() //=> "4f90d13a42"244```245246```js247import { customAlphabet } from 'nanoid/non-secure'248const nanoid = customAlphabet('1234567890abcdef', 10)249user.id = nanoid()250```251252Check the safety of your custom alphabet and ID size in our253[ID collision probability] calculator. For more alphabets, check out the options254in [`nanoid-dictionary`].255256Alphabet must contain 256 symbols or less.257Otherwise, the security of the internal generator algorithm is not guaranteed.258259In addition to setting a default size, you can change the ID size when calling260the function:261262```js263import { customAlphabet } from 'nanoid'264const nanoid = customAlphabet('1234567890abcdef', 10)265model.id = nanoid(5) //=> "f01a2"266```267

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

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

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 269–281why, one step back
269
270### Custom Random Bytes Generator271272`customRandom` allows you to create a `nanoid` and replace alphabet273and the default random bytes generator.274275In this example, a seed-based generator is used:276277```js278import { customRandom } from 'nanoid'279280const rng = seedrandom(seed)281const nanoid = customRandom('abcdef', 10, size => {

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 282why, one step back
282 return new Uint8Array(size).map(() => 256 * rng())

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 283–294why, one step back
283})
284285nanoid() //=> "fbaefaadeb"286```287288`random` callback must accept the array size and return an array289with random numbers.290291If you want to use the same URL-friendly symbols with `customRandom`,292you can get the default alphabet using the `urlAlphabet`.293294```js

Fix outdated info and links in README (#566)Mahmoud Hamdybefore adoptionc7ca9e9

line 295why, one step back
295import { customRandom, urlAlphabet } from 'nanoid'

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 296–310why, one step back
296const nanoid = customRandom(urlAlphabet, 10, random)
297```298299Note, that between Nano ID versions we may change random generator300call sequence. If you are using seed-based generators, we do not guarantee301the same result.302303## Usage304305### React306307There’s no correct way to use Nano ID for React `key` prop308since it should be consistent among renders.309310```jsx

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

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

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 312–314why, one step back
312 return (
313 <ul>314 {todos.map(todo => (

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 315–317why, one step back
315 <li key={nanoid()}>
316 {' '}317 /* DON’T DO IT */

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 318–328why, one step back
318 {todo.text}
319 </li>320 ))}321 </ul>322 )323}324```325326You should rather try to reach for stable ID inside your list item.327328```jsx

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

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

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 330–335why, one step back
330```
331332In case you don’t have stable IDs you'd rather use index as `key`333instead of `nanoid()`:334335```jsx

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 336–340why, one step back
336const todoItems = todos.map((text, index) => (
337 <li key={index}>338 {' '}339 /* Still not recommended but preferred over nanoid(). Only do this if items340 have no stable IDs. */

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 341–342why, one step back
341 {text}
342 </li>

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 343why, one step back
343))

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 344–349why, one step back
344```
345346In case you just need random IDs to link elements like labels347and input fields together, [`useId`] is recommended.348That hook was added in React 18.349

Fix outdated info and links in README (#566)Mahmoud Hamdybefore adoptionc7ca9e9

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

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 351–407why, one step back
351
352### React Native353354React Native does not have built-in random generator. The following polyfill355works for plain React Native and Expo starting with `39.x`.3563571. Check [`react-native-get-random-values`] docs and install it.3582. Import it before Nano ID.359360```js361import 'react-native-get-random-values'362import { nanoid } from 'nanoid'363```364365[`react-native-get-random-values`]: https://github.com/LinusU/react-native-get-random-values366367### PouchDB and CouchDB368369In PouchDB and CouchDB, IDs can’t start with an underscore `_`.370A prefix is required to prevent this issue, as Nano ID might use a `_`371at the start of the ID by default.372373Override the default ID with the following option:374375```js376db.put({377 _id: 'id' + nanoid(),378 …379})380```381382### CLI383384You can get unique ID in terminal by calling `npx nanoid`. You need only385Node.js in the system. You do not need Nano ID to be installed anywhere.386387```sh388$ npx nanoid389npx: installed 1 in 0.63s390LZfXLFzPPR4NNrgjlWDxn391```392393Size of generated ID can be specified with `--size` (or `-s`) option:394395```sh396$ npx nanoid --size 10397L3til0JS4z398```399400Custom alphabet can be specified with `--alphabet` (or `-a`) option401(note that in this case `--size` is required):402403```sh404$ npx nanoid --alphabet abc --size 15405bccbcabaabaccab406```407

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

lines 408–414why, one step back
408### TypeScript
409410Nano ID allows casting generated strings into opaque strings in TypeScript.411For example:412413```ts414declare const userIdBrand: unique symbol

Clean up docsAndrey Sitnikbefore adoptionf7862cb

line 415why, one step back
415type UserId = string & { [userIdBrand]: true }

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

line 416why, one step back
416

Clean up docsAndrey Sitnikbefore adoptionf7862cb

lines 417–419why, one step back
417// Use explicit type parameter:
418mockUser(nanoid<UserId>())419

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

lines 420–430why, one step back
420interface User {
421 id: UserId422 name: string423}424425const user: User = {426 // Automatically casts to UserId:427 id: nanoid(),428 name: 'Alice'429}430```

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 431–436why, one step back
431
432### Other Programming Languages433434Nano ID was ported to many languages. You can use these ports to have435the same ID generator on the client and server side.436

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 437–457why, one step back
437- [C](https://github.com/lukateras/nanoid.h)
438- [C#](https://github.com/codeyu/nanoid-net)439- [C++](https://github.com/mcmikecreations/nanoid_cpp)440- [Clojure and ClojureScript](https://github.com/zelark/nano-id)441- [ColdFusion/CFML](https://github.com/JamoCA/cfml-nanoid)442- [Crystal](https://github.com/mamantoha/nanoid.cr)443- [Dart & Flutter](https://github.com/pd4d10/nanoid-dart)444- [Elixir](https://github.com/railsmechanic/nanoid)445- [Gleam](https://github.com/0xca551e/glanoid)446- [Go](https://github.com/matoous/go-nanoid)447- [Haskell](https://github.com/MichelBoucey/NanoID)448- [Haxe](https://github.com/flashultra/uuid)449- [Janet](https://sr.ht/~statianzo/janet-nanoid/)450- [Java](https://github.com/wosherco/jnanoid-enhanced)451- [Kotlin](https://github.com/viascom/nanoid-kotlin)452- [MySQL/MariaDB](https://github.com/viascom/nanoid-mysql-mariadb)453- [Nim](https://github.com/icyphox/nanoid.nim)454- [OCaml](https://github.com/routineco/ocaml-nanoid)455- [Perl](https://github.com/tkzwtks/Nanoid-perl)456- [PHP](https://github.com/hidehalo/nanoid-php)457- Python [native](https://github.com/puyuan/py-nanoid) implementation

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

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

Add python fastnanoid (#478)Oliver Lambsonbefore adoption81b5315

line 459why, one step back
459 and [fast](https://github.com/oliverlambson/fastnanoid) implementation (written in Rust)

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 460why, one step back
460- Postgres [Extension](https://github.com/spa5k/uids-postgres)

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 461why, one step back
461 and [Native Function](https://github.com/viascom/nanoid-postgres)

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 462–468why, one step back
462- [R](https://github.com/hrbrmstr/nanoid) (with dictionaries)
463- [Ruby](https://github.com/radeno/nanoid.rb)464- [Rust](https://github.com/nikolay-govorov/nanoid)465- [Swift](https://github.com/ShivaHuang/swift-nanoid)466- [Unison](https://share.unison-lang.org/latest/namespaces/hojberg/nanoid)467- [V](https://github.com/invipal/nanoid)468- [Zig](https://github.com/SasLuca/zig-nanoid)

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

lines 469–475why, one step back
469
470For other environments, [CLI] is available to generate IDs from a command line.471472[CLI]: #cli473474## Tools475

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

line 476why, one step back
476- [ID size calculator] shows collision probability when adjusting

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

line 477why, one step back
477 the ID alphabet or size.

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 478–479why, one step back
478- [`nanoid-dictionary`] with popular alphabets to use with [`customAlphabet`].
479- [`nanoid-good`] to be sure that your ID doesn’t contain any obscene words.

Use Github ReleasesAndrey Sitnikbefore adoptioncea4beb

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

Move from Prettier and ESLint to oxfmt and oxlintAndrey Sitnikbefore adoption4bf7b85

lines 482–484why, one step back
482[ID size calculator]: https://zelark.github.io/nano-id-cc/
483[`customAlphabet`]: #custom-alphabet-or-size484[`nanoid-good`]: https://github.com/y-gagar1n/nanoid-good