Skip to content
Myr

Cleanup README (#200)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Dair Aidarkhanov · committed by GitHub · parent 13617d2 · Browse files · 1 file+5 added−5 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+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:README.md+5 added-5 removed
182 unmodified lines
183184```jsx185const Element = () => {186 const [id] = React.useState(nanoid)187 return <Item key={id}>187 return <Item key={id} />188}189```190191If you want to use Nano ID in the `key` prop, you must set some string prefix
49 unmodified lines
241242### ES Modules243244Nano ID provides ES modules. You do not need to do anything to use Nano ID245as ESM in webpack, Parcel, or Node.js.245as ESM in Webpack, Parcel, or Node.js.246247```js248import { nanoid } from 'nanoid'249```
56 unmodified lines
306307### Async308309To generate hardware random bytes, CPU collects electromagnetic noise.310In the synchronous API during the noise collection,311the CPU does not do anything useful.310In the synchronous API during the noise collection, the CPU is busy and311cannot do anything useful in parallel.312313Using the asynchronous API of Nano ID, another code can run during314the entropy collection.315
13 unmodified lines
329### Non-Secure330331By default, Nano ID uses hardware random bytes generation for security332and low collision probability. If you are not so concerned with security333and more with performance, you can use the faster non-secure generator.333and more concerned with performance, you can use the faster non-secure generator.334335```js336import { nanoid } from 'nanoid/non-secure'337const id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqLJ"
73 unmodified lines