Comparing version 2.1.1 to 2.1.2
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 2.1.2 | ||
* Improve docs. | ||
## 2.1.1 | ||
@@ -5,0 +8,0 @@ * Fix React Native support (by Shawn Hwei). |
/** | ||
* Generate URL-friendly unique ID. This method use non-secure predictable | ||
* random generator. | ||
* random generator with bigger collision probability. | ||
* | ||
* By default, ID will have 21 symbols to have a collision probability similar | ||
* to UUID v4. | ||
* | ||
* @param {string} alphabet Symbols to be used in ID. | ||
@@ -9,0 +6,0 @@ * @param {number} [size=21] The number of symbols in ID. |
@@ -5,7 +5,4 @@ var url = 'bjectSymhasOwnProp-0123456789ABCDEFGHIJKLMNQRTUVWXYZ_dfgiklquvxz' | ||
* Generate URL-friendly unique ID. This method use non-secure predictable | ||
* random generator. | ||
* random generator with bigger collision probability. | ||
* | ||
* By default, ID will have 21 symbols to have a collision probability similar | ||
* to UUID v4. | ||
* | ||
* @param {number} [size=21] The number of symbols in ID. | ||
@@ -12,0 +9,0 @@ * |
{ | ||
"name": "nanoid", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "A tiny (141 bytes), secure URL-friendly unique string ID generator", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -47,4 +47,5 @@ # Nano ID | ||
1. [Async](#async) | ||
2. [Custom Alphabet or Length](#custom-alphabet-or-length) | ||
3. [Custom Random Bytes Generator](#custom-random-bytes-generator) | ||
2. [Non-Secure](#non-secure) | ||
3. [Custom Alphabet or Length](#custom-alphabet-or-length) | ||
4. [Custom Random Bytes Generator](#custom-random-bytes-generator) | ||
@@ -246,3 +247,4 @@ | ||
If you don’t need unpredictable IDs, but you need Web Workers support, | ||
you can use non‑secure ID generator. | ||
you can use non‑secure ID generator. Note, that they have bigger collision | ||
probability. | ||
@@ -302,2 +304,16 @@ ```js | ||
### Non-Secure | ||
By default, Nano ID uses hardware random generator for security | ||
and low collision probability. If you don’t need it, you can use | ||
very fast non-secure generator. | ||
```js | ||
const nonSecure = require('nanoid/non-secure') | ||
const id = nonSecure() //=> "Uakgb_J5m9g-0JDMbcJqLJ" | ||
``` | ||
Note that it is predictable and have bigger collision probability. | ||
### Custom Alphabet or Length | ||
@@ -304,0 +320,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24911
396
378