@thi.ng/random 3.6.0 → 3.6.1
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 +8 -1
- package/README.md +1 -1
- package/package.json +2 -2
- package/uuid.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-08-
|
|
3
|
+
- **Last updated**: 2023-08-12T16:14:35Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [3.6.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/random@3.6.1) (2023-08-12)
|
|
13
|
+
|
|
14
|
+
#### ⏱ Performance improvements
|
|
15
|
+
|
|
16
|
+
- add/re-use internal buf for uuid() ([6bf7f1d](https://github.com/thi-ng/umbrella/commit/6bf7f1d))
|
|
17
|
+
- avoid temp allocations (10% faster)
|
|
18
|
+
|
|
12
19
|
## [3.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/random@3.6.0) (2023-08-12)
|
|
13
20
|
|
|
14
21
|
#### 🚀 Features
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/random",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Pseudo-random number generators w/ unified API, distributions, weighted choices, ID generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"ksuid"
|
|
157
157
|
]
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "4154283d772824d4b57d4b7ab97be22a6e1ffdd7\n"
|
|
160
160
|
}
|
package/uuid.js
CHANGED
|
@@ -15,6 +15,8 @@ export const uuidv4Bytes = (buf, rnd) => {
|
|
|
15
15
|
buf[8] = 0x80 | (buf[8] & 0x3f);
|
|
16
16
|
return buf;
|
|
17
17
|
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
const __buf = new Uint8Array(16);
|
|
18
20
|
/**
|
|
19
21
|
* Returns a UUID string, either from given byte array, or if omitted, using a
|
|
20
22
|
* new UUID v4 produced by {@link uuidv4Bytes}.
|
|
@@ -22,4 +24,4 @@ export const uuidv4Bytes = (buf, rnd) => {
|
|
|
22
24
|
* @param id - byte array
|
|
23
25
|
* @param i - start index
|
|
24
26
|
*/
|
|
25
|
-
export const uuid = (id, i = 0) => $uuid(id || uuidv4Bytes(), i);
|
|
27
|
+
export const uuid = (id, i = 0) => $uuid(id || uuidv4Bytes(__buf), i);
|