Clean up Security section
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Andrey Sitnik · committed by Andrey Sitnik · parent 88c2127 · Browse files · 1 file·+12 added−26 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+12 added−26 removed
- other:+12 added−26 removed
Provenance
- Commit
7cebc46- Tree
d8c727a- Author
Andrey Sitnik <andrey@sitnik.ru>- Committer
Andrey Sitnik <andrey@sitnik.ru>- Parent
88c2127
1 file changed+12 added−26 removed
modified:README.md+12 added-26 removed
35 unmodified lines36 * [Comparison with UUID](#comparison-with-uuid)37 * [Benchmark](#benchmark)38 * [Tools](#tools)39 * [Security](#security)40- * [Unpredictability](#unpredictability)41- * [Uniformity](#uniformity)42- * [Vulnerabilities](#vulnerabilities)40 * [Usage](#usage)41 * [JS](#js)42 * [React](#react)43 * [React Native](#react-native)67 unmodified lines111 *See a good article about random generators theory:112 [Secure random values (in Node.js)]*113 114 118-### Unpredictability115+* **Unpredictability.** Instead of using the unsafe `Math.random()`, Nano ID116+ uses the `crypto` module in Node.js and the Web Crypto API in browsers.117+ These modules use unpredictable hardware random generator.118+* **Uniformity.** `random % alphabet` is a popular mistake to make when coding119+ an ID generator. The spread will not be even; there will be a lower chance120+ for some symbols to appear compared to others—so it will reduce the number121+ of tries when brute-forcing. Nano ID uses a [better algorithm] and is tested for uniformity.122 120-Instead of using the unsafe `Math.random()`, Nano ID uses the `crypto` module121-in Node.js and the Web Crypto API in browsers. These modules use unpredictable122-hardware random generator.123-124-125-### Uniformity126-127-`random % alphabet` is a popular mistake to make when coding an ID generator.128-The spread will not be even; there will be a lower chance for some symbols129-to appear compared to others—so it will reduce the number of tries130-when brute-forcing.131-132-Nano ID uses a [better algorithm] and is tested for uniformity.133-134-<img src="img/distribution.png" alt="Nano ID uniformity"123+ <img src="img/distribution.png" alt="Nano ID uniformity"124 width="340" height="135">125 126+* **Vulnerabilities:** to report a security vulnerability, please use127+ the [Tidelift security contact](https://tidelift.com/security).128+ Tidelift will coordinate the fix and disclosure.129+130 [Secure random values (in Node.js)]: https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba131 [better algorithm]: https://github.com/ai/nanoid/blob/master/format.js132 133 141-### Vulnerabilities142-143-To report a security vulnerability, please use the144-[Tidelift security contact](https://tidelift.com/security).145-Tidelift will coordinate the fix and disclosure.146-147-134 ## Usage135 136 ### JS137 252 unmodified lines