Skip to content
Myr

Fix random pool break

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 974f73b · Browse files · 2 files+13 added−0 removed
This commit

State

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

Diff stats

2 files+13 added−0 removed

  • tests:+12 added−0 removed
  • other:+1 added−0 removed

2 files+13 added−0 removed

modified:test/index.test.js+12 added
74 unmodified lines
75 let third = nanoid()76 notEqual(second, third)77 })7879 if (type === 'node') {80 test(`avoids pool break`, () => {81 nanoid()82 try {83 nanoid(2147483648)84 } catch {}85 let third = nanoid()86 let fourth = nanoid()87 notEqual(third, fourth)88 })89 }9091 test(`has flat distribution`, () => {92 let COUNT = 100 * 100093 let LENGTH = nanoid().length94
177 unmodified lines
modified:index.js+1 added