@thi.ng/random 3.0.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [3.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.0.2...@thi.ng/random@3.0.3) (2021-10-15)
6
+ ## [3.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.1.3...@thi.ng/random@3.1.4) (2021-11-10)
7
7
 
8
8
  **Note:** Version bump only for package @thi.ng/random
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [3.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.0.1...@thi.ng/random@3.0.2) (2021-10-15)
14
+ ## [3.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.1.2...@thi.ng/random@3.1.3) (2021-11-03)
15
15
 
16
16
  **Note:** Version bump only for package @thi.ng/random
17
17
 
@@ -19,9 +19,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- ## [3.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.0.0...@thi.ng/random@3.0.1) (2021-10-13)
22
+ # [3.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@3.0.3...@thi.ng/random@3.1.0) (2021-10-25)
23
23
 
24
- **Note:** Version bump only for package @thi.ng/random
24
+
25
+ ### Features
26
+
27
+ * **random:** add pickRandom() ([0899aed](https://github.com/thi-ng/umbrella/commit/0899aed89fd691df4ddc5273995a579414f506d8))
25
28
 
26
29
 
27
30
 
@@ -56,129 +59,129 @@ Also:
56
59
 
57
60
 
58
61
 
59
- ## [2.4.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.4.3...@thi.ng/random@2.4.4) (2021-08-04)
62
+ ## [2.4.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.4.3...@thi.ng/random@2.4.4) (2021-08-04)
60
63
 
61
- ### Bug Fixes
64
+ ### Bug Fixes
62
65
 
63
- - **random:** update weightedRandom() ([70afa70](https://github.com/thi-ng/umbrella/commit/70afa7097dfd21f85d947ab5f055d0c39589fd48))
66
+ - **random:** update weightedRandom() ([70afa70](https://github.com/thi-ng/umbrella/commit/70afa7097dfd21f85d947ab5f055d0c39589fd48))
64
67
 
65
- # [2.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.3.7...@thi.ng/random@2.4.0) (2021-04-19)
68
+ # [2.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.3.7...@thi.ng/random@2.4.0) (2021-04-19)
66
69
 
67
- ### Bug Fixes
70
+ ### Bug Fixes
68
71
 
69
- - **random:** HOF issue w/ exponential() ([12586b9](https://github.com/thi-ng/umbrella/commit/12586b9eda66ce3d741402cc9b802c0369f64d88))
72
+ - **random:** HOF issue w/ exponential() ([12586b9](https://github.com/thi-ng/umbrella/commit/12586b9eda66ce3d741402cc9b802c0369f64d88))
70
73
 
71
- ### Features
74
+ ### Features
72
75
 
73
- - **random:** add uniqueValuesFrom/uniqueIndices() ([3b3b5d8](https://github.com/thi-ng/umbrella/commit/3b3b5d8d71d8c3019f84bae7a4791b12933720c4))
76
+ - **random:** add uniqueValuesFrom/uniqueIndices() ([3b3b5d8](https://github.com/thi-ng/umbrella/commit/3b3b5d8d71d8c3019f84bae7a4791b12933720c4))
74
77
 
75
- ## [2.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.3.0...@thi.ng/random@2.3.1) (2021-02-24)
78
+ ## [2.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.3.0...@thi.ng/random@2.3.1) (2021-02-24)
76
79
 
77
- ### Bug Fixes
80
+ ### Bug Fixes
78
81
 
79
- - **random:** update weightedRandom() ([b1cf4d8](https://github.com/thi-ng/umbrella/commit/b1cf4d8feccac4b3468a2fb0fdee268306406d78))
82
+ - **random:** update weightedRandom() ([b1cf4d8](https://github.com/thi-ng/umbrella/commit/b1cf4d8feccac4b3468a2fb0fdee268306406d78))
80
83
 
81
- # [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.2.0...@thi.ng/random@2.3.0) (2021-02-20)
84
+ # [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.2.0...@thi.ng/random@2.3.0) (2021-02-20)
82
85
 
83
- ### Features
86
+ ### Features
84
87
 
85
- - **random:** add coin()/fairCoin() ([ed66a64](https://github.com/thi-ng/umbrella/commit/ed66a64a7e5efb63b4bbab89bba5100d1aa7ec49))
88
+ - **random:** add coin()/fairCoin() ([ed66a64](https://github.com/thi-ng/umbrella/commit/ed66a64a7e5efb63b4bbab89bba5100d1aa7ec49))
86
89
 
87
- # [2.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.1.5...@thi.ng/random@2.2.0) (2021-01-13)
90
+ # [2.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.1.5...@thi.ng/random@2.2.0) (2021-01-13)
88
91
 
89
- ### Bug Fixes
92
+ ### Bug Fixes
90
93
 
91
- - **random:** add opt start index arg for uuid() ([268ec3f](https://github.com/thi-ng/umbrella/commit/268ec3f47470184068fd66b5cc147d8c2e0e0ccb))
94
+ - **random:** add opt start index arg for uuid() ([268ec3f](https://github.com/thi-ng/umbrella/commit/268ec3f47470184068fd66b5cc147d8c2e0e0ccb))
92
95
 
93
- ### Features
96
+ ### Features
94
97
 
95
- - **random:** add CRYPTO IRandom impl ([94e69c1](https://github.com/thi-ng/umbrella/commit/94e69c1021ec67c63be78e0467bfc82be6cabc00))
96
- - **random:** add opt start/end for randomBytes() ([4d095da](https://github.com/thi-ng/umbrella/commit/4d095da557b1f3ee9ce46778aeba25f0c6aa94f9))
98
+ - **random:** add CRYPTO IRandom impl ([94e69c1](https://github.com/thi-ng/umbrella/commit/94e69c1021ec67c63be78e0467bfc82be6cabc00))
99
+ - **random:** add opt start/end for randomBytes() ([4d095da](https://github.com/thi-ng/umbrella/commit/4d095da557b1f3ee9ce46778aeba25f0c6aa94f9))
97
100
 
98
- ### Performance Improvements
101
+ ### Performance Improvements
99
102
 
100
- - **random:** minor update weightedRandom() ([258fd7b](https://github.com/thi-ng/umbrella/commit/258fd7b25930c41025b7337b44c36e1f00924b47))
103
+ - **random:** minor update weightedRandom() ([258fd7b](https://github.com/thi-ng/umbrella/commit/258fd7b25930c41025b7337b44c36e1f00924b47))
101
104
 
102
- ## [2.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.1.0...@thi.ng/random@2.1.1) (2020-11-26)
105
+ ## [2.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.1.0...@thi.ng/random@2.1.1) (2020-11-26)
103
106
 
104
- ### Bug Fixes
107
+ ### Bug Fixes
105
108
 
106
- - **random:** add missing subdir to pkg "files" ([916dbe7](https://github.com/thi-ng/umbrella/commit/916dbe7eb12815215b3905ea6ad924b7d397264c))
109
+ - **random:** add missing subdir to pkg "files" ([916dbe7](https://github.com/thi-ng/umbrella/commit/916dbe7eb12815215b3905ea6ad924b7d397264c))
107
110
 
108
- # [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.0.2...@thi.ng/random@2.1.0) (2020-11-24)
111
+ # [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@2.0.2...@thi.ng/random@2.1.0) (2020-11-24)
109
112
 
110
- ### Features
113
+ ### Features
111
114
 
112
- - **random:** add distribution HOFs, move gaussian() ([9328821](https://github.com/thi-ng/umbrella/commit/9328821b20e9534c4c66c353d36dfd7dbb5edda6))
113
- - **random:** add randomBytesFrom(), update UUID fns ([b31c872](https://github.com/thi-ng/umbrella/commit/b31c872cb67708510d68d6b2e2260cba843ee86d))
115
+ - **random:** add distribution HOFs, move gaussian() ([9328821](https://github.com/thi-ng/umbrella/commit/9328821b20e9534c4c66c353d36dfd7dbb5edda6))
116
+ - **random:** add randomBytesFrom(), update UUID fns ([b31c872](https://github.com/thi-ng/umbrella/commit/b31c872cb67708510d68d6b2e2260cba843ee86d))
114
117
 
115
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.4.17...@thi.ng/random@2.0.0) (2020-08-28)
118
+ # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.4.17...@thi.ng/random@2.0.0) (2020-08-28)
116
119
 
117
- ### Bug Fixes
120
+ ### Bug Fixes
118
121
 
119
- - **random:** off-by-one error in SYSTEM.int() ([ca0492d](https://github.com/thi-ng/umbrella/commit/ca0492d2f5f867c8945c279f60cf908037df1385))
122
+ - **random:** off-by-one error in SYSTEM.int() ([ca0492d](https://github.com/thi-ng/umbrella/commit/ca0492d2f5f867c8945c279f60cf908037df1385))
120
123
 
121
- ### Features
124
+ ### Features
122
125
 
123
- - **random:** add INorm, extract gaussianCLT() ([c687598](https://github.com/thi-ng/umbrella/commit/c687598f87283a77c109d6b378b1907349eab760))
126
+ - **random:** add INorm, extract gaussianCLT() ([c687598](https://github.com/thi-ng/umbrella/commit/c687598f87283a77c109d6b378b1907349eab760))
124
127
 
125
- ### BREAKING CHANGES
128
+ ### BREAKING CHANGES
126
129
 
127
- - **random:** remove gaussian() from IRandom, extract as standalone gaussianCLT()
128
- - update gaussianCLT() default args to be more meaningful
130
+ - **random:** remove gaussian() from IRandom, extract as standalone gaussianCLT()
131
+ - update gaussianCLT() default args to be more meaningful
129
132
 
130
- # [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.3.2...@thi.ng/random@1.4.0) (2020-03-01)
133
+ # [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.3.2...@thi.ng/random@1.4.0) (2020-03-01)
131
134
 
132
- ### Bug Fixes
135
+ ### Bug Fixes
133
136
 
134
- - **random:** use correct 160bit default seed for XorWow ([38d511b](https://github.com/thi-ng/umbrella/commit/38d511bc2e2c0bf00101e0b9db50cdb371445425))
137
+ - **random:** use correct 160bit default seed for XorWow ([38d511b](https://github.com/thi-ng/umbrella/commit/38d511bc2e2c0bf00101e0b9db50cdb371445425))
135
138
 
136
- ### Features
139
+ ### Features
137
140
 
138
- - **random:** add Xoshiro128, refactor default seeds ([b535628](https://github.com/thi-ng/umbrella/commit/b535628c879b133d121307695a2a138dac70f008))
141
+ - **random:** add Xoshiro128, refactor default seeds ([b535628](https://github.com/thi-ng/umbrella/commit/b535628c879b133d121307695a2a138dac70f008))
139
142
 
140
- # [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.2.0...@thi.ng/random@1.3.0) (2020-02-25)
143
+ # [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.2.0...@thi.ng/random@1.3.0) (2020-02-25)
141
144
 
142
- ### Features
145
+ ### Features
143
146
 
144
- - **random:** add uuidv4Bytes() ([e9ea10f](https://github.com/thi-ng/umbrella/commit/e9ea10f5e6b2415863e1a552207758aa3a47c9cf))
147
+ - **random:** add uuidv4Bytes() ([e9ea10f](https://github.com/thi-ng/umbrella/commit/e9ea10f5e6b2415863e1a552207758aa3a47c9cf))
145
148
 
146
- # [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.15...@thi.ng/random@1.2.0) (2020-01-26)
149
+ # [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.15...@thi.ng/random@1.2.0) (2020-01-26)
147
150
 
148
- ### Features
151
+ ### Features
149
152
 
150
- - **random:** add randomBytes() wrapper ([c536bcd](https://github.com/thi-ng/umbrella/commit/c536bcd83c766414e349f6b82494ace9888ac2ba))
153
+ - **random:** add randomBytes() wrapper ([c536bcd](https://github.com/thi-ng/umbrella/commit/c536bcd83c766414e349f6b82494ace9888ac2ba))
151
154
 
152
- ## [1.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.14...@thi.ng/random@1.1.15) (2020-01-24)
155
+ ## [1.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.14...@thi.ng/random@1.1.15) (2020-01-24)
153
156
 
154
- ### Performance Improvements
157
+ ### Performance Improvements
155
158
 
156
- - **random:** minor update ARandom.norm() ([babbbaa](https://github.com/thi-ng/umbrella/commit/babbbaa12b5be09415f420e7559fa5c8bb76f802))
159
+ - **random:** minor update ARandom.norm() ([babbbaa](https://github.com/thi-ng/umbrella/commit/babbbaa12b5be09415f420e7559fa5c8bb76f802))
157
160
 
158
- # [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.0.2...@thi.ng/random@1.1.0) (2019-02-15)
161
+ # [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.0.2...@thi.ng/random@1.1.0) (2019-02-15)
159
162
 
160
- ### Bug Fixes
163
+ ### Bug Fixes
161
164
 
162
- - **random:** add opt scale arg to IRandom.float() ([5a7e448](https://github.com/thi-ng/umbrella/commit/5a7e448))
165
+ - **random:** add opt scale arg to IRandom.float() ([5a7e448](https://github.com/thi-ng/umbrella/commit/5a7e448))
163
166
 
164
- ### Features
167
+ ### Features
165
168
 
166
- - **random:** add randomID() & weightedRandom() ([f719724](https://github.com/thi-ng/umbrella/commit/f719724))
169
+ - **random:** add randomID() & weightedRandom() ([f719724](https://github.com/thi-ng/umbrella/commit/f719724))
167
170
 
168
- # [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@0.1.1...@thi.ng/random@1.0.0) (2019-01-21)
171
+ # [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@0.1.1...@thi.ng/random@1.0.0) (2019-01-21)
169
172
 
170
- ### Build System
173
+ ### Build System
171
174
 
172
- - update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
175
+ - update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
173
176
 
174
- ### BREAKING CHANGES
177
+ ### BREAKING CHANGES
175
178
 
176
- - enabled multi-outputs (ES6 modules, CJS, UMD)
177
- - build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
178
- - all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
179
+ - enabled multi-outputs (ES6 modules, CJS, UMD)
180
+ - build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
181
+ - all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
179
182
 
180
- # 0.1.0 (2018-11-24)
183
+ # 0.1.0 (2018-11-24)
181
184
 
182
- ### Features
185
+ ### Features
183
186
 
184
187
  - **random:** re-import, extend & refactor random package (MBP2010) ([4aea85d](https://github.com/thi-ng/umbrella/commit/4aea85d))
package/README.md CHANGED
@@ -89,7 +89,7 @@ node --experimental-repl-await
89
89
  > const random = await import("@thi.ng/random");
90
90
  ```
91
91
 
92
- Package sizes (gzipped, pre-treeshake): ESM: 1.82 KB
92
+ Package sizes (gzipped, pre-treeshake): ESM: 1.83 KB
93
93
 
94
94
  ## Dependencies
95
95
 
package/index.d.ts CHANGED
@@ -1,21 +1,22 @@
1
1
  export * from "./api.js";
2
2
  export * from "./arandom.js";
3
- export * from "./crypto.js";
4
- export * from "./smush32.js";
5
- export * from "./system.js";
6
- export * from "./xoshiro128.js";
7
- export * from "./xorshift128.js";
8
- export * from "./xorwow.js";
9
- export * from "./xsadd.js";
10
3
  export * from "./coin.js";
11
- export * from "./random-bytes.js";
12
- export * from "./random-id.js";
13
- export * from "./unique-indices.js";
14
- export * from "./uuid.js";
15
- export * from "./weighted-random.js";
4
+ export * from "./crypto.js";
16
5
  export * from "./distributions/exponential.js";
17
6
  export * from "./distributions/gaussian.js";
18
7
  export * from "./distributions/geometric.js";
19
8
  export * from "./distributions/normal.js";
20
9
  export * from "./distributions/uniform.js";
10
+ export * from "./pick-random.js";
11
+ export * from "./random-bytes.js";
12
+ export * from "./random-id.js";
13
+ export * from "./smush32.js";
14
+ export * from "./system.js";
15
+ export * from "./unique-indices.js";
16
+ export * from "./uuid.js";
17
+ export * from "./weighted-random.js";
18
+ export * from "./xorshift128.js";
19
+ export * from "./xorwow.js";
20
+ export * from "./xoshiro128.js";
21
+ export * from "./xsadd.js";
21
22
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,20 +1,21 @@
1
1
  export * from "./api.js";
2
2
  export * from "./arandom.js";
3
- export * from "./crypto.js";
4
- export * from "./smush32.js";
5
- export * from "./system.js";
6
- export * from "./xoshiro128.js";
7
- export * from "./xorshift128.js";
8
- export * from "./xorwow.js";
9
- export * from "./xsadd.js";
10
3
  export * from "./coin.js";
11
- export * from "./random-bytes.js";
12
- export * from "./random-id.js";
13
- export * from "./unique-indices.js";
14
- export * from "./uuid.js";
15
- export * from "./weighted-random.js";
4
+ export * from "./crypto.js";
16
5
  export * from "./distributions/exponential.js";
17
6
  export * from "./distributions/gaussian.js";
18
7
  export * from "./distributions/geometric.js";
19
8
  export * from "./distributions/normal.js";
20
9
  export * from "./distributions/uniform.js";
10
+ export * from "./pick-random.js";
11
+ export * from "./random-bytes.js";
12
+ export * from "./random-id.js";
13
+ export * from "./smush32.js";
14
+ export * from "./system.js";
15
+ export * from "./unique-indices.js";
16
+ export * from "./uuid.js";
17
+ export * from "./weighted-random.js";
18
+ export * from "./xorshift128.js";
19
+ export * from "./xorwow.js";
20
+ export * from "./xoshiro128.js";
21
+ export * from "./xsadd.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/random",
3
- "version": "3.0.3",
3
+ "version": "3.1.4",
4
4
  "description": "Pseudo-random number generators w/ unified API, distributions, weighted choices, ID generation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,13 +34,13 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.0.3",
38
- "@thi.ng/checks": "^3.0.3",
39
- "@thi.ng/errors": "^2.0.3",
40
- "@thi.ng/hex": "^2.0.3"
37
+ "@thi.ng/api": "^8.2.0",
38
+ "@thi.ng/checks": "^3.0.7",
39
+ "@thi.ng/errors": "^2.0.6",
40
+ "@thi.ng/hex": "^2.0.6"
41
41
  },
42
42
  "devDependencies": {
43
- "@thi.ng/testament": "^0.1.3"
43
+ "@thi.ng/testament": "^0.1.6"
44
44
  },
45
45
  "keywords": [
46
46
  "binary",
@@ -105,6 +105,9 @@
105
105
  "./distributions/uniform": {
106
106
  "import": "./distributions/uniform.js"
107
107
  },
108
+ "./pick-random": {
109
+ "import": "./pick-random.js"
110
+ },
108
111
  "./random-bytes": {
109
112
  "import": "./random-bytes.js"
110
113
  },
@@ -145,5 +148,5 @@
145
148
  "ksuid"
146
149
  ]
147
150
  },
148
- "gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
151
+ "gitHead": "5fe52419af63984ebe53032201b2a6174b9cb159"
149
152
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Returns a random element from `src` using given {@link IRandom} instance
3
+ * (default: {@link SYSTEM}). The index selection will be constrained to the
4
+ * `[start,end)` interval (default: entire array).
5
+ *
6
+ * @param src
7
+ * @param rnd
8
+ * @param start
9
+ * @param end
10
+ */
11
+ export declare const pickRandom: <T>(src: ArrayLike<T>, rnd?: import("./system.js").SystemRandom, start?: number, end?: number) => T;
12
+ //# sourceMappingURL=pick-random.d.ts.map
package/pick-random.js ADDED
@@ -0,0 +1,12 @@
1
+ import { SYSTEM } from "./system.js";
2
+ /**
3
+ * Returns a random element from `src` using given {@link IRandom} instance
4
+ * (default: {@link SYSTEM}). The index selection will be constrained to the
5
+ * `[start,end)` interval (default: entire array).
6
+ *
7
+ * @param src
8
+ * @param rnd
9
+ * @param start
10
+ * @param end
11
+ */
12
+ export const pickRandom = (src, rnd = SYSTEM, start = 0, end = src.length) => src[rnd.minmax(start, end) | 0];
package/random-id.js CHANGED
@@ -23,7 +23,7 @@ import { SYSTEM } from "./system.js";
23
23
  */
24
24
  export const randomID = (len = 4, prefix = "", syms = "abcdefghijklmnopqrstuvwxyz", rnd = SYSTEM) => {
25
25
  const n = syms.length;
26
- for (; --len >= 0;) {
26
+ for (; len-- > 0;) {
27
27
  prefix += syms[rnd.int() % n];
28
28
  }
29
29
  return prefix;