Skip to content
Myr

Update library size in docs

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 a252998 · Browse files · 3 files+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

3 files+5 added−5 removed

  • other:+5 added−5 removed

3 files+5 added−5 removed

modified:package.json+1 added-1 removed
modified:README-cn.md+2 added-2 removed
5 unmodified lines
6一个用于 JavaScript 的唯一字符串 ID 生成器,它迷你、安全,并且对 URL 友好。78**安全:** 它使用了一系列密码学上的非常健壮的 API,并且测试了各种符号的分布。910**体积小:** 压缩并打包后仅占 145 字节,无依赖,它使用 [Size Limit] 来控制体积。10**体积小:** 压缩并打包后仅占 143 字节,无依赖,它使用 [Size Limit] 来控制体积。1112**紧凑的:** 它使用了一个比 UUID 更大的字符表 (`A-Za-z0-9_~`)。因此,他可以将 ID 长度从 36 缩减至 21。1314```js
44 unmodified lines
5960Nano ID 和 UUID v4 有两个主要的区别:61621. Nano ID 使用了一个更大的字符表,因此一个类似长度的随机位数可以被封装到 21 个字符里,而不是 36 个。632. Nano ID 的代码体积大小比 `uuid/v4` 小三倍: 145 字节,而不是 435 字节。632. Nano ID 的代码体积大小比 `uuid/v4` 小三倍: 143 字节,而不是 435 字节。646566## 性能基准(Benchmark)67
148 unmodified lines
modified:README.md+2 added-2 removed
6 unmodified lines
78**Safe.** It uses cryptographically strong random APIs9and tests distribution of symbols.1011**Small.** 145 bytes (minified and gzipped). No dependencies.11**Small.** 143 bytes (minified and gzipped). No dependencies.12It uses [Size Limit] to control size.1314**Compact.** It uses a larger alphabet than UUID (`A-Za-z0-9_~`).15As result it could reduce ID size from 36 to 21 symbols.
56 unmodified lines
72731. Nano ID uses a bigger alphabet, so a similar number of random bits74 are packed in just 21 symbols instead of 36.752. Nano ID code is 3 times less than `uuid/v4` package:76 145 bytes instead of 435.76 143 bytes instead of 435.777879## Benchmark80
166 unmodified lines