nanoid 3.1.20 → 3.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nanoid might be problematic. Click here for more details.
- package/README.md +53 -40
- package/async/index.d.ts +3 -3
- package/index.browser.js +1 -2
- package/index.cjs +2 -2
- package/index.d.ts +5 -5
- package/index.dev.js +1 -2
- package/index.js +2 -2
- package/index.prod.js +1 -2
- package/non-secure/index.d.ts +2 -2
- package/package.json +14 -6
- package/CHANGELOG.md +0 -241
package/README.md
CHANGED
@@ -47,7 +47,6 @@ Supports modern browsers, IE [with Babel], Node.js and React Native.
|
|
47
47
|
* [Create React App](#create-react-app)
|
48
48
|
* [React Native](#react-native)
|
49
49
|
* [Rollup](#rollup)
|
50
|
-
* [Expo](#expo)
|
51
50
|
* [PouchDB and CouchDB](#pouchdb-and-couchdb)
|
52
51
|
* [Mongoose](#mongoose)
|
53
52
|
* [ES Modules](#es-modules)
|
@@ -139,7 +138,7 @@ Test configuration: Dell XPS 2-in-1 7390, Fedora 32, Node.js 15.1.
|
|
139
138
|
Tidelift will coordinate the fix and disclosure.
|
140
139
|
|
141
140
|
[Secure random values (in Node.js)]: https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba
|
142
|
-
[better algorithm]: https://github.com/ai/nanoid/blob/
|
141
|
+
[better algorithm]: https://github.com/ai/nanoid/blob/main/index.js
|
143
142
|
|
144
143
|
|
145
144
|
## Usage
|
@@ -154,6 +153,12 @@ import { nanoid } from 'nanoid'
|
|
154
153
|
model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
|
155
154
|
```
|
156
155
|
|
156
|
+
In Node.js you can use CommonJS import:
|
157
|
+
|
158
|
+
```js
|
159
|
+
const { nanoid } = require('nanoid')
|
160
|
+
```
|
161
|
+
|
157
162
|
If you want to reduce the ID size (and increase collisions probability),
|
158
163
|
you can pass the size as an argument.
|
159
164
|
|
@@ -192,22 +197,43 @@ import { nanoid } from 'nanoid'
|
|
192
197
|
|
193
198
|
### React
|
194
199
|
|
195
|
-
|
196
|
-
among renders.
|
200
|
+
There’s currently no correct way to use nanoid for React `key` prop
|
201
|
+
since it should be consistent among renders.
|
197
202
|
|
198
|
-
|
203
|
+
```jsx
|
204
|
+
function Todos({todos}) {
|
205
|
+
return (
|
206
|
+
<ul>
|
207
|
+
{todos.map(todo => (
|
208
|
+
<li key={nanoid()}> /* DON’T DO IT */
|
209
|
+
{todo.text}
|
210
|
+
</li>
|
211
|
+
))}
|
212
|
+
</ul>
|
213
|
+
)
|
214
|
+
}
|
215
|
+
```
|
216
|
+
|
217
|
+
You should rather try to reach for stable id inside your list item.
|
199
218
|
|
200
219
|
```jsx
|
201
|
-
|
220
|
+
const todoItems = todos.map((todo) =>
|
221
|
+
<li key={todo.id}>
|
222
|
+
{todo.text}
|
223
|
+
</li>
|
224
|
+
)
|
202
225
|
```
|
203
226
|
|
204
|
-
|
227
|
+
In case you don’t have stable ids you'd rather use index as `key`
|
228
|
+
instead of `nanoid()`:
|
205
229
|
|
206
230
|
```jsx
|
207
|
-
const
|
208
|
-
|
209
|
-
|
210
|
-
}
|
231
|
+
const todoItems = todos.map((text, index) =>
|
232
|
+
<li key={index}> /* Still not recommended but preferred over nanoid().
|
233
|
+
Only do this if items have no stable IDs. */
|
234
|
+
{text}
|
235
|
+
</li>
|
236
|
+
)
|
211
237
|
```
|
212
238
|
|
213
239
|
If you want to use Nano ID in the `id` prop, you must set some string prefix
|
@@ -220,22 +246,21 @@ If you want to use Nano ID in the `id` prop, you must set some string prefix
|
|
220
246
|
|
221
247
|
### Create React App
|
222
248
|
|
223
|
-
Create React App
|
224
|
-
with ES modules packages.
|
249
|
+
Create React App < 4.0.0 had
|
250
|
+
[a problem](https://github.com/ai/nanoid/issues/205) with ES modules packages.
|
225
251
|
|
226
252
|
```
|
227
253
|
TypeError: (0 , _nanoid.nanoid) is not a function
|
228
254
|
```
|
229
255
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
Use Nano ID 2 `npm i nanoid@^2.0.0` until Create React App 4.0 release.
|
256
|
+
Use Nano ID 2 `npm i nanoid@^2.0.0` if you're using a version below
|
257
|
+
CRA 4.0.
|
234
258
|
|
235
259
|
|
236
260
|
### React Native
|
237
261
|
|
238
|
-
React Native does not have built-in random generator.
|
262
|
+
React Native does not have built-in random generator. The following polyfill
|
263
|
+
works for plain React Native and Expo starting with `39.x`.
|
239
264
|
|
240
265
|
1. Check [`react-native-get-random-values`] docs and install it.
|
241
266
|
2. Import it before Nano ID.
|
@@ -252,39 +277,25 @@ For Expo framework see the next section.
|
|
252
277
|
|
253
278
|
### Rollup
|
254
279
|
|
255
|
-
For Rollup you will need [`@rollup/plugin-
|
280
|
+
For Rollup you will need [`@rollup/plugin-node-resolve`] to bundle browser version
|
281
|
+
of this library and [`@rollup/plugin-replace`] to replace
|
256
282
|
`process.env.NODE_ENV`:
|
257
283
|
|
258
284
|
```js
|
259
285
|
plugins: [
|
286
|
+
nodeResolve({
|
287
|
+
browser: true
|
288
|
+
}),
|
260
289
|
replace({
|
261
|
-
'process.env.NODE_ENV': JSON.stringify(process.env.
|
290
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
262
291
|
})
|
263
292
|
]
|
264
293
|
```
|
265
294
|
|
295
|
+
[`@rollup/plugin-node-resolve`]: https://github.com/rollup/plugins/tree/master/packages/node-resolve
|
266
296
|
[`@rollup/plugin-replace`]: https://github.com/rollup/plugins/tree/master/packages/replace
|
267
297
|
|
268
298
|
|
269
|
-
### Expo
|
270
|
-
|
271
|
-
If you use Expo in React Native, you need a different workaround.
|
272
|
-
|
273
|
-
1. Install [`expo-random`](https://www.npmjs.com/package/expo-random).
|
274
|
-
2. Use `nanoid/async` instead of `nanoid`.
|
275
|
-
3. Import `index.native.js` file directly.
|
276
|
-
|
277
|
-
```js
|
278
|
-
import { nanoid } from 'nanoid/async/index.native'
|
279
|
-
|
280
|
-
async function createUser () {
|
281
|
-
user.id = await nanoid()
|
282
|
-
}
|
283
|
-
```
|
284
|
-
|
285
|
-
[`expo-random`]: https://www.npmjs.com/package/expo-random
|
286
|
-
|
287
|
-
|
288
299
|
### PouchDB and CouchDB
|
289
300
|
|
290
301
|
In PouchDB and CouchDB, IDs can’t start with an underscore `_`.
|
@@ -375,7 +386,7 @@ the same ID generator on the client and server side.
|
|
375
386
|
* [C++](https://github.com/mcmikecreations/nanoid_cpp)
|
376
387
|
* [Clojure and ClojureScript](https://github.com/zelark/nano-id)
|
377
388
|
* [Crystal](https://github.com/mamantoha/nanoid.cr)
|
378
|
-
* [Dart](https://github.com/pd4d10/nanoid-dart)
|
389
|
+
* [Dart & Flutter](https://github.com/pd4d10/nanoid-dart)
|
379
390
|
* [Deno](https://github.com/ianfabs/nanoid)
|
380
391
|
* [Go](https://github.com/matoous/go-nanoid)
|
381
392
|
* [Elixir](https://github.com/railsmechanic/nanoid)
|
@@ -383,12 +394,14 @@ the same ID generator on the client and server side.
|
|
383
394
|
* [Janet](https://sr.ht/~statianzo/janet-nanoid/)
|
384
395
|
* [Java](https://github.com/aventrix/jnanoid)
|
385
396
|
* [Nim](https://github.com/icyphox/nanoid.nim)
|
397
|
+
* [Perl](https://github.com/tkzwtks/Nanoid-perl)
|
386
398
|
* [PHP](https://github.com/hidehalo/nanoid-php)
|
387
399
|
* [Python](https://github.com/puyuan/py-nanoid)
|
388
400
|
with [dictionaries](https://pypi.org/project/nanoid-dictionary)
|
389
401
|
* [Ruby](https://github.com/radeno/nanoid.rb)
|
390
402
|
* [Rust](https://github.com/nikolay-govorov/nanoid)
|
391
403
|
* [Swift](https://github.com/antiflasher/NanoID)
|
404
|
+
* [V](https://github.com/invipal/nanoid)
|
392
405
|
|
393
406
|
Also, [CLI] is available to generate IDs from a command line.
|
394
407
|
|
package/async/index.d.ts
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
* @param size Size of the ID. The default size is 21.
|
15
15
|
* @returns A promise with a random string.
|
16
16
|
*/
|
17
|
-
export function nanoid
|
17
|
+
export function nanoid(size?: number): Promise<string>
|
18
18
|
|
19
19
|
/**
|
20
20
|
* A low-level function.
|
@@ -35,7 +35,7 @@ export function nanoid (size?: number): Promise<string>
|
|
35
35
|
* })
|
36
36
|
* ```
|
37
37
|
*/
|
38
|
-
export function customAlphabet
|
38
|
+
export function customAlphabet(
|
39
39
|
alphabet: string,
|
40
40
|
size: number
|
41
41
|
): () => Promise<string>
|
@@ -53,4 +53,4 @@ export function customAlphabet (
|
|
53
53
|
* @param bytes Size of the array.
|
54
54
|
* @returns A promise with a random bytes array.
|
55
55
|
*/
|
56
|
-
export function random
|
56
|
+
export function random(bytes: number): Promise<Uint8Array>
|
package/index.browser.js
CHANGED
@@ -14,8 +14,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
14
14
|
'React Native does not have a built-in secure random generator. ' +
|
15
15
|
'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +
|
16
16
|
'For secure IDs, import `react-native-get-random-values` ' +
|
17
|
-
'before Nano ID.
|
18
|
-
'and use `nanoid/async`.'
|
17
|
+
'before Nano ID.'
|
19
18
|
)
|
20
19
|
}
|
21
20
|
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {
|
package/index.cjs
CHANGED
@@ -49,7 +49,7 @@ let customRandom = (alphabet, size, getRandom) => {
|
|
49
49
|
let id = ''
|
50
50
|
while (true) {
|
51
51
|
let bytes = getRandom(step)
|
52
|
-
// A compact alternative for `for (
|
52
|
+
// A compact alternative for `for (let i = 0; i < step; i++)`.
|
53
53
|
let i = step
|
54
54
|
while (i--) {
|
55
55
|
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
|
@@ -65,7 +65,7 @@ let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)
|
|
65
65
|
let nanoid = (size = 21) => {
|
66
66
|
let bytes = random(size)
|
67
67
|
let id = ''
|
68
|
-
// A compact alternative for `for (
|
68
|
+
// A compact alternative for `for (let i = 0; i < size; i++)`.
|
69
69
|
while (size--) {
|
70
70
|
// It is incorrect to use bytes exceeding the alphabet size.
|
71
71
|
// The following mask reduces the random byte in the 0-255 value
|
package/index.d.ts
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
* @param size Size of the ID. The default size is 21.
|
13
13
|
* @returns A random string.
|
14
14
|
*/
|
15
|
-
export function nanoid
|
15
|
+
export function nanoid(size?: number): string
|
16
16
|
|
17
17
|
/**
|
18
18
|
* Generate secure unique ID with custom alphabet.
|
@@ -30,7 +30,7 @@ export function nanoid (size?: number): string
|
|
30
30
|
* nanoid() //=> "8ё56а"
|
31
31
|
* ```
|
32
32
|
*/
|
33
|
-
export function customAlphabet
|
33
|
+
export function customAlphabet(alphabet: string, size: number): () => string
|
34
34
|
|
35
35
|
/**
|
36
36
|
* Generate unique ID with custom random generator and alphabet.
|
@@ -57,7 +57,7 @@ export function customAlphabet (alphabet: string, size: number): () => string
|
|
57
57
|
* @param random A random bytes generator.
|
58
58
|
* @returns A random string generator.
|
59
59
|
*/
|
60
|
-
export function customRandom
|
60
|
+
export function customRandom(
|
61
61
|
alphabet: string,
|
62
62
|
size: number,
|
63
63
|
random: (bytes: number) => Uint8Array
|
@@ -68,7 +68,7 @@ export function customRandom (
|
|
68
68
|
*
|
69
69
|
* ```js
|
70
70
|
* import { urlAlphabet } from 'nanoid'
|
71
|
-
* const nanoid =
|
71
|
+
* const nanoid = customAlphabet(urlAlphabet, 10)
|
72
72
|
* nanoid() //=> "Uakgb_J5m9"
|
73
73
|
* ```
|
74
74
|
*/
|
@@ -85,4 +85,4 @@ export const urlAlphabet: string
|
|
85
85
|
* @param bytes Size of the array.
|
86
86
|
* @returns An array of random bytes.
|
87
87
|
*/
|
88
|
-
export function random
|
88
|
+
export function random(bytes: number): Uint8Array
|
package/index.dev.js
CHANGED
@@ -14,8 +14,7 @@ if (true) {
|
|
14
14
|
'React Native does not have a built-in secure random generator. ' +
|
15
15
|
'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +
|
16
16
|
'For secure IDs, import `react-native-get-random-values` ' +
|
17
|
-
'before Nano ID.
|
18
|
-
'and use `nanoid/async`.'
|
17
|
+
'before Nano ID.'
|
19
18
|
)
|
20
19
|
}
|
21
20
|
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {
|
package/index.js
CHANGED
@@ -49,7 +49,7 @@ let customRandom = (alphabet, size, getRandom) => {
|
|
49
49
|
let id = ''
|
50
50
|
while (true) {
|
51
51
|
let bytes = getRandom(step)
|
52
|
-
// A compact alternative for `for (
|
52
|
+
// A compact alternative for `for (let i = 0; i < step; i++)`.
|
53
53
|
let i = step
|
54
54
|
while (i--) {
|
55
55
|
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
|
@@ -65,7 +65,7 @@ let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)
|
|
65
65
|
let nanoid = (size = 21) => {
|
66
66
|
let bytes = random(size)
|
67
67
|
let id = ''
|
68
|
-
// A compact alternative for `for (
|
68
|
+
// A compact alternative for `for (let i = 0; i < size; i++)`.
|
69
69
|
while (size--) {
|
70
70
|
// It is incorrect to use bytes exceeding the alphabet size.
|
71
71
|
// The following mask reduces the random byte in the 0-255 value
|
package/index.prod.js
CHANGED
@@ -14,8 +14,7 @@ if (false) {
|
|
14
14
|
'React Native does not have a built-in secure random generator. ' +
|
15
15
|
'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +
|
16
16
|
'For secure IDs, import `react-native-get-random-values` ' +
|
17
|
-
'before Nano ID.
|
18
|
-
'and use `nanoid/async`.'
|
17
|
+
'before Nano ID.'
|
19
18
|
)
|
20
19
|
}
|
21
20
|
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {
|
package/non-secure/index.d.ts
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
* @param size Size of the ID. The default size is 21.
|
11
11
|
* @returns A random string.
|
12
12
|
*/
|
13
|
-
export function nanoid
|
13
|
+
export function nanoid(size?: number): string
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Generate URL-friendly unique ID based on the custom alphabet.
|
@@ -27,4 +27,4 @@ export function nanoid (size?: number): string
|
|
27
27
|
* model.id = //=> "8ё56а"
|
28
28
|
* ```
|
29
29
|
*/
|
30
|
-
export function customAlphabet
|
30
|
+
export function customAlphabet(alphabet: string, size: number): () => string
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nanoid",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.24",
|
4
4
|
"description": "A tiny (108 bytes), secure URL-friendly unique string ID generator",
|
5
5
|
"keywords": [
|
6
6
|
"uuid",
|
@@ -15,7 +15,10 @@
|
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": "ai/nanoid",
|
17
17
|
"browser": {
|
18
|
-
"./index.js": "./index.browser.js"
|
18
|
+
"./index.js": "./index.browser.js",
|
19
|
+
"./index.cjs": "./index.browser.js",
|
20
|
+
"./async/index.js": "./async/index.browser.js",
|
21
|
+
"./async/index.cjs": "./async/index.browser.js"
|
19
22
|
},
|
20
23
|
"react-native": "index.js",
|
21
24
|
"bin": "./bin/nanoid.cjs",
|
@@ -28,10 +31,12 @@
|
|
28
31
|
".": {
|
29
32
|
"browser": {
|
30
33
|
"development": "./index.dev.js",
|
31
|
-
"production": "./index.prod.js"
|
34
|
+
"production": "./index.prod.js",
|
35
|
+
"default": "./index.prod.js"
|
32
36
|
},
|
33
37
|
"require": "./index.cjs",
|
34
38
|
"import": "./index.js",
|
39
|
+
"default": "./index.js",
|
35
40
|
"types": "./index.d.ts"
|
36
41
|
},
|
37
42
|
"./package.json": "./package.json",
|
@@ -39,17 +44,20 @@
|
|
39
44
|
"./async": {
|
40
45
|
"browser": "./async/index.browser.js",
|
41
46
|
"require": "./async/index.cjs",
|
42
|
-
"import": "./async/index.js"
|
47
|
+
"import": "./async/index.js",
|
48
|
+
"default": "./async/index.js"
|
43
49
|
},
|
44
50
|
"./non-secure/package.json": "./non-secure/package.json",
|
45
51
|
"./non-secure": {
|
46
52
|
"require": "./non-secure/index.cjs",
|
47
|
-
"import": "./non-secure/index.js"
|
53
|
+
"import": "./non-secure/index.js",
|
54
|
+
"default": "./non-secure/index.js"
|
48
55
|
},
|
49
56
|
"./url-alphabet/package.json": "./url-alphabet/package.json",
|
50
57
|
"./url-alphabet": {
|
51
58
|
"require": "./url-alphabet/index.cjs",
|
52
|
-
"import": "./url-alphabet/index.js"
|
59
|
+
"import": "./url-alphabet/index.js",
|
60
|
+
"default": "./url-alphabet/index.js"
|
53
61
|
},
|
54
62
|
"./index.d.ts": "./index.d.ts"
|
55
63
|
}
|
package/CHANGELOG.md
DELETED
@@ -1,241 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
|
-
|
4
|
-
## 3.1.20
|
5
|
-
* Fix ES modules support.
|
6
|
-
|
7
|
-
## 3.1.19
|
8
|
-
* Reduced `customAlphabet` size (by Enrico Scherlies).
|
9
|
-
|
10
|
-
## 3.1.18
|
11
|
-
* Fixed `package.exports`.
|
12
|
-
|
13
|
-
## 3.1.17
|
14
|
-
* Added files without `process`.
|
15
|
-
|
16
|
-
## 3.1.16
|
17
|
-
* Speeded up Nano ID 4 times (by Peter Boyer).
|
18
|
-
|
19
|
-
## 3.1.15
|
20
|
-
* Fixed `package.types` path.
|
21
|
-
|
22
|
-
## 3.1.14
|
23
|
-
* Added `package.types`.
|
24
|
-
|
25
|
-
## 3.1.13
|
26
|
-
* Removed Node.js 15.0.0 with `randomFillSync` regression from `engines.node`.
|
27
|
-
|
28
|
-
## 3.1.12
|
29
|
-
* Improved IE 11 docs.
|
30
|
-
|
31
|
-
## 3.1.11
|
32
|
-
* Fixed asynchronous `customAlphabet` in browser (by @LoneRifle).
|
33
|
-
|
34
|
-
## 3.1.10
|
35
|
-
* Fix ES modules support.
|
36
|
-
|
37
|
-
## 3.1.9
|
38
|
-
* Try to fix React Native Expo support.
|
39
|
-
|
40
|
-
## 3.1.8
|
41
|
-
* Add React Native Expo support.
|
42
|
-
|
43
|
-
## 3.1.7
|
44
|
-
* Clean up code.
|
45
|
-
|
46
|
-
## 3.1.6
|
47
|
-
* Avoid `self` using.
|
48
|
-
|
49
|
-
## 3.1.5
|
50
|
-
* Improve IE docs and warning.
|
51
|
-
|
52
|
-
## 3.1.4
|
53
|
-
* Restrict old Node.js 13 by `engines.node` (by Cansin Yildiz).
|
54
|
-
|
55
|
-
## 3.1.3
|
56
|
-
* Fix ES modules issue with CLI.
|
57
|
-
|
58
|
-
## 3.1.2
|
59
|
-
* Add shebang to CLI.
|
60
|
-
|
61
|
-
## 3.1.1
|
62
|
-
* Fix CLI.
|
63
|
-
|
64
|
-
## 3.1
|
65
|
-
* Add `npx nanoid` CLI.
|
66
|
-
|
67
|
-
## 3.0.2
|
68
|
-
* Fix docs (by Dylan Irlbeck ).
|
69
|
-
|
70
|
-
## 3.0.1
|
71
|
-
* Fix React Native warning on `non-secure` import (by Jia Huang).
|
72
|
-
|
73
|
-
## 3.0
|
74
|
-
**Migration guide:** <https://github.com/ai/nanoid/releases/tag/3.0.0>
|
75
|
-
* Move to ES2016 syntax. You need to use Babel for IE 11.
|
76
|
-
* Move to named exports `import { nanoid } from 'nanoid'`.
|
77
|
-
* Move `import url from 'nanoid/url'` to `import { urlAlphabet } from 'nanoid'`.
|
78
|
-
* Replace `format()` to `customRandom()`.
|
79
|
-
* Replace `generate()` to `customAlphabet()`.
|
80
|
-
* Remove `async/format`.
|
81
|
-
* Remove React Native support for `nanoid/async`.
|
82
|
-
* Add `nanoid.js` to use directly in browser from CDN.
|
83
|
-
* Add TypeScript type definitions.
|
84
|
-
* Add ES modules support for bundlers, Node.js, and React Native.
|
85
|
-
* Fix React Native support.
|
86
|
-
* Reduce size.
|
87
|
-
* Improve docs (by Dair Aidarkhanov).
|
88
|
-
|
89
|
-
## 2.1.11
|
90
|
-
* Reduce size (by Anton Evzhakov).
|
91
|
-
|
92
|
-
## 2.1.10
|
93
|
-
* Reduce size by 10% (by Anton Khlynovskiy).
|
94
|
-
|
95
|
-
## 2.1.9
|
96
|
-
* Reduce `format` and `async/format` size (by Dair Aidarkhanov).
|
97
|
-
|
98
|
-
## 2.1.8
|
99
|
-
* Improve React docs (by Nahum Zsilva).
|
100
|
-
|
101
|
-
## 2.1.7
|
102
|
-
* Reduce `index`, `async` and `non-secure` size (by @polemius).
|
103
|
-
|
104
|
-
## 2.1.6
|
105
|
-
* Reduce size (by Stas Lashmanov).
|
106
|
-
* Return fast mask for Node.js.
|
107
|
-
|
108
|
-
## 2.1.5
|
109
|
-
* Reduce size (by Max Graey).
|
110
|
-
* Fix IE support.
|
111
|
-
|
112
|
-
## 2.1.4
|
113
|
-
* Reduce `generate` size (by Vsevolod Rodionov).
|
114
|
-
* Reduce `format` and `format` size (by Victor).
|
115
|
-
* Reduce `async`, `non-secure` and `non-secure/generate` size.
|
116
|
-
* Speed up `format` and `async/format` (by Max Graey).
|
117
|
-
* Improve development process on Windows (by Stanislav Lashmanov).
|
118
|
-
|
119
|
-
## 2.1.3
|
120
|
-
* Improve performance (by Stephen Richardson).
|
121
|
-
* Reduce size (by Stephen Richardson).
|
122
|
-
|
123
|
-
## 2.1.2
|
124
|
-
* Improve docs.
|
125
|
-
|
126
|
-
## 2.1.1
|
127
|
-
* Fix React Native support (by Shawn Hwei).
|
128
|
-
|
129
|
-
## 2.1
|
130
|
-
* Improve React Native support (by Sebastian Werner).
|
131
|
-
|
132
|
-
## 2.0.4
|
133
|
-
* Improve error text for React Native (by Sebastian Werner).
|
134
|
-
|
135
|
-
## 2.0.3
|
136
|
-
* Fix freeze on string in ID length.
|
137
|
-
|
138
|
-
## 2.0.2
|
139
|
-
* Improve docs (by Sylvanus Kateile and Mark Stosberg).
|
140
|
-
|
141
|
-
## 2.0.1
|
142
|
-
* Reduce npm package size.
|
143
|
-
* Mark package as not having side effects (by @xiaody).
|
144
|
-
|
145
|
-
## 2.0
|
146
|
-
* Use `-` instead of `~` in default alphabet to by file name safe.
|
147
|
-
* Add `nanoid/non-secure/generate`.
|
148
|
-
|
149
|
-
## 1.3.4
|
150
|
-
* Reduce `non-secure` size.
|
151
|
-
* Add `async` callback type check.
|
152
|
-
|
153
|
-
## 1.3.3
|
154
|
-
* Fix `nanoid/async` performance regression.
|
155
|
-
* Fix old Node.js `not seeded` issue in synchronous version too.
|
156
|
-
|
157
|
-
## 1.3.2
|
158
|
-
* Fix random generator `not seeded` issue of old Node.js.
|
159
|
-
|
160
|
-
## 1.3.1
|
161
|
-
* Reduce library size.
|
162
|
-
|
163
|
-
## 1.3
|
164
|
-
* Add `nanoid/async/format` and `nanoid/async/generate`.
|
165
|
-
* Improve synchronous API performance.
|
166
|
-
* Reduce `url` size (by Daniil Poroshin).
|
167
|
-
* Improve React Native docs (by joelgetaction).
|
168
|
-
|
169
|
-
## 1.2.6
|
170
|
-
* Reduce library size (by rqrqrqrq).
|
171
|
-
|
172
|
-
## 1.2.5
|
173
|
-
* Fix Node.js 6.11.1 support (by Andrey Belym).
|
174
|
-
|
175
|
-
## 1.2.4
|
176
|
-
* Speed up Node.js secure generators (by Dmitriy Tsvettsikh).
|
177
|
-
|
178
|
-
## 1.2.3
|
179
|
-
* Fix JSDoc (by Hendry Sadrak).
|
180
|
-
|
181
|
-
## 1.2.2
|
182
|
-
* Fix distribution in `nanoid/non-secure` (by Eatall).
|
183
|
-
|
184
|
-
## 1.2.1
|
185
|
-
* Fix old Node.js support.
|
186
|
-
|
187
|
-
## 1.2
|
188
|
-
* Add `nanoid/async`.
|
189
|
-
* Fix `nanoid/non-secure` JSDoc.
|
190
|
-
* Add Chinese documentation (by Wenliang Dai).
|
191
|
-
* Speed up and reduce size of `nanoid/non-secure` (by Ori Livni).
|
192
|
-
|
193
|
-
## 1.1.1
|
194
|
-
* Improve performance and reduce size of non-secure ID generator.
|
195
|
-
|
196
|
-
## 1.1
|
197
|
-
* Add non-secure ID generator.
|
198
|
-
* Suggest to use non-secure ID generator for React Native developers.
|
199
|
-
* Reduce size.
|
200
|
-
|
201
|
-
## 1.0.7
|
202
|
-
* Fix documentation.
|
203
|
-
|
204
|
-
## 1.0.6
|
205
|
-
* Fix documentation.
|
206
|
-
|
207
|
-
## 1.0.5
|
208
|
-
* Reduce `nanoid/index` size (by Anton Khlynovskiy).
|
209
|
-
|
210
|
-
## 1.0.4
|
211
|
-
* Reduce npm package size.
|
212
|
-
|
213
|
-
## 1.0.3
|
214
|
-
* Reduce npm package size.
|
215
|
-
|
216
|
-
## 1.0.2
|
217
|
-
* Fix Web Workers support (by Zachary Golba).
|
218
|
-
|
219
|
-
## 1.0.1
|
220
|
-
* Reduce `nanoid/index` size (by Anton Khlynovskiy).
|
221
|
-
|
222
|
-
## 1.0
|
223
|
-
* Use 21 symbols by default (by David Klebanoff).
|
224
|
-
|
225
|
-
## 0.2.2
|
226
|
-
* Reduce `nanoid/generate` size (by Anton Khlynovskiy).
|
227
|
-
* Speed up Node.js random generator.
|
228
|
-
|
229
|
-
## 0.2.1
|
230
|
-
* Fix documentation (by Piper Chester).
|
231
|
-
|
232
|
-
## 0.2
|
233
|
-
* Add `size` argument to `nanoid()`.
|
234
|
-
* Improve performance by 50%.
|
235
|
-
* Reduce library size by 26% (by Vsevolod Rodionov and Oleg Mokhov).
|
236
|
-
|
237
|
-
## 0.1.1
|
238
|
-
* Reduce library size by 5%.
|
239
|
-
|
240
|
-
## 0.1
|
241
|
-
* Initial release.
|