uuid 3.2.1 → 3.3.0

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
@@ -2,15 +2,40 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="3.3.0"></a>
6
+ # [3.3.0](https://github.com/kelektiv/node-uuid/compare/v3.2.1...v3.3.0) (2018-06-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * assignment to readonly property to allow running in strict mode ([#270](https://github.com/kelektiv/node-uuid/issues/270)) ([d062fdc](https://github.com/kelektiv/node-uuid/commit/d062fdc))
12
+ * fix [#229](https://github.com/kelektiv/node-uuid/issues/229) ([c9684d4](https://github.com/kelektiv/node-uuid/commit/c9684d4))
13
+ * Get correct version of IE11 crypto ([#274](https://github.com/kelektiv/node-uuid/issues/274)) ([153d331](https://github.com/kelektiv/node-uuid/commit/153d331))
14
+ * mem issue when generating uuid ([#267](https://github.com/kelektiv/node-uuid/issues/267)) ([c47702c](https://github.com/kelektiv/node-uuid/commit/c47702c))
15
+
16
+ ### Features
17
+
18
+ * enforce Conventional Commit style commit messages ([#282](https://github.com/kelektiv/node-uuid/issues/282)) ([cc9a182](https://github.com/kelektiv/node-uuid/commit/cc9a182))
19
+
20
+
5
21
  <a name="3.2.1"></a>
6
- ## [3.2.1](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.2.1) (2018-01-16)
22
+ ## [3.2.1](https://github.com/kelektiv/node-uuid/compare/v3.2.0...v3.2.1) (2018-01-16)
7
23
 
8
24
 
9
25
  ### Bug Fixes
10
26
 
27
+ * assignment to readonly property to allow running in strict mode ([#270](https://github.com/kelektiv/node-uuid/issues/270)) ([d062fdc](https://github.com/kelektiv/node-uuid/commit/d062fdc))
28
+ * fix [#229](https://github.com/kelektiv/node-uuid/issues/229) ([c9684d4](https://github.com/kelektiv/node-uuid/commit/c9684d4))
29
+ * Get correct version of IE11 crypto ([#274](https://github.com/kelektiv/node-uuid/issues/274)) ([153d331](https://github.com/kelektiv/node-uuid/commit/153d331))
30
+ * mem issue when generating uuid ([#267](https://github.com/kelektiv/node-uuid/issues/267)) ([c47702c](https://github.com/kelektiv/node-uuid/commit/c47702c))
11
31
  * use msCrypto if available. Fixes [#241](https://github.com/kelektiv/node-uuid/issues/241) ([#247](https://github.com/kelektiv/node-uuid/issues/247)) ([1fef18b](https://github.com/kelektiv/node-uuid/commit/1fef18b))
12
32
 
13
33
 
34
+ ### Features
35
+
36
+ * enforce Conventional Commit style commit messages ([#282](https://github.com/kelektiv/node-uuid/issues/282)) ([cc9a182](https://github.com/kelektiv/node-uuid/commit/cc9a182))
37
+
38
+
14
39
 
15
40
  <a name="3.2.0"></a>
16
41
  # [3.2.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.2.0) (2018-01-16)
@@ -27,31 +52,48 @@ All notable changes to this project will be documented in this file. See [standa
27
52
  * Add v3 Support ([#217](https://github.com/kelektiv/node-uuid/issues/217)) ([d94f726](https://github.com/kelektiv/node-uuid/commit/d94f726))
28
53
 
29
54
 
55
+ # [3.1.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.0.1) (2017-06-17)
56
+
57
+ ### Bug Fixes
58
+
59
+ * (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183)
60
+ * Fix typo (#178)
61
+ * Simple typo fix (#165)
62
+
63
+ ### Features
64
+ * v5 support in CLI (#197)
65
+ * V5 support (#188)
66
+
30
67
 
31
68
  # 3.0.1 (2016-11-28)
32
69
 
33
- * split uuid versions into separate files
70
+ * split uuid versions into separate files
71
+
34
72
 
35
73
  # 3.0.0 (2016-11-17)
36
74
 
37
- * remove .parse and .unparse
75
+ * remove .parse and .unparse
76
+
38
77
 
39
78
  # 2.0.0
40
79
 
41
- * Removed uuid.BufferClass
80
+ * Removed uuid.BufferClass
81
+
42
82
 
43
83
  # 1.4.0
44
84
 
45
- * Improved module context detection
46
- * Removed public RNG functions
85
+ * Improved module context detection
86
+ * Removed public RNG functions
87
+
47
88
 
48
89
  # 1.3.2
49
90
 
50
- * Improve tests and handling of v1() options (Issue #24)
51
- * Expose RNG option to allow for perf testing with different generators
91
+ * Improve tests and handling of v1() options (Issue #24)
92
+ * Expose RNG option to allow for perf testing with different generators
93
+
52
94
 
53
95
  # 1.3.0
54
96
 
55
- * Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
56
- * Support for node.js crypto API
57
- * De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
97
+ * Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
98
+ * Support for node.js crypto API
99
+ * De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
package/README.md CHANGED
@@ -28,7 +28,7 @@ Version 1 (timestamp):
28
28
 
29
29
  ```javascript
30
30
  const uuidv1 = require('uuid/v1');
31
- uuidv1(); // ⇨ 'f64f2940-fae4-11e7-8c5f-ef356f279131'
31
+ uuidv1(); // ⇨ '22643650-7944-11e8-8ca7-93cbb72bf7b7'
32
32
 
33
33
  ```
34
34
 
@@ -56,7 +56,7 @@ Version 4 (random):
56
56
 
57
57
  ```javascript
58
58
  const uuidv4 = require('uuid/v4');
59
- uuidv4(); // ⇨ '416ac246-e7ac-49ff-93b4-f7e94d997e6b'
59
+ uuidv4(); // ⇨ '7afe74af-5a7d-4a4e-a3c1-ebe44f564695'
60
60
 
61
61
  ```
62
62
 
@@ -167,8 +167,8 @@ Example: In-place generation of two binary IDs
167
167
  ```javascript
168
168
  // Generate two ids in an array
169
169
  const arr = new Array();
170
- uuidv1(null, arr, 0); // ⇨ [ 246, 87, 141, 176, 250, 228, 17, 231, 146, 52, 239, 53, 111, 39, 145, 49 ]
171
- uuidv1(null, arr, 16); // ⇨ [ 246, 87, 141, 176, 250, 228, 17, 231, 146, 52, 239, 53, 111, 39, 145, 49, 246, 87, 180, 192, 250, 228, 17, 231, 146, 52, 239, 53, 111, 39, 145, 49 ]
170
+ uuidv1(null, arr, 0); // ⇨ [ 34, 101, 32, 176, 121, 68, 17, 232, 146, 52, 147, 203, 183, 43, 247, 183 ]
171
+ uuidv1(null, arr, 16); // ⇨ [ 34, 101, 32, 176, 121, 68, 17, 232, 146, 52, 147, 203, 183, 43, 247, 183, 34, 101, 71, 192, 121, 68, 17, 232, 146, 52, 147, 203, 183, 43, 247, 183 ]
172
172
 
173
173
  ```
174
174
 
@@ -237,8 +237,8 @@ Example: Generate two IDs in a single buffer
237
237
 
238
238
  ```javascript
239
239
  const buffer = new Array();
240
- uuidv4(null, buffer, 0); // ⇨ [ 175, 10, 162, 184, 217, 255, 77, 139, 161, 80, 41, 200, 70, 238, 196, 250 ]
241
- uuidv4(null, buffer, 16); // ⇨ [ 175, 10, 162, 184, 217, 255, 77, 139, 161, 80, 41, 200, 70, 238, 196, 250, 75, 162, 105, 153, 48, 238, 77, 58, 169, 56, 158, 207, 106, 160, 47, 239 ]
240
+ uuidv4(null, buffer, 0); // ⇨ [ 99, 19, 185, 60, 95, 165, 69, 65, 170, 166, 39, 0, 243, 153, 94, 148 ]
241
+ uuidv4(null, buffer, 16); // ⇨ [ 99, 19, 185, 60, 95, 165, 69, 65, 170, 166, 39, 0, 243, 153, 94, 148, 208, 145, 176, 198, 100, 47, 65, 92, 182, 96, 194, 143, 212, 122, 218, 15 ]
242
242
 
243
243
  ```
244
244
 
@@ -10,14 +10,15 @@ for (var i = 0; i < 256; ++i) {
10
10
  function bytesToUuid(buf, offset) {
11
11
  var i = offset || 0;
12
12
  var bth = byteToHex;
13
- return bth[buf[i++]] + bth[buf[i++]] +
14
- bth[buf[i++]] + bth[buf[i++]] + '-' +
15
- bth[buf[i++]] + bth[buf[i++]] + '-' +
16
- bth[buf[i++]] + bth[buf[i++]] + '-' +
17
- bth[buf[i++]] + bth[buf[i++]] + '-' +
18
- bth[buf[i++]] + bth[buf[i++]] +
19
- bth[buf[i++]] + bth[buf[i++]] +
20
- bth[buf[i++]] + bth[buf[i++]];
13
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
14
+ return ([bth[buf[i++]], bth[buf[i++]],
15
+ bth[buf[i++]], bth[buf[i++]], '-',
16
+ bth[buf[i++]], bth[buf[i++]], '-',
17
+ bth[buf[i++]], bth[buf[i++]], '-',
18
+ bth[buf[i++]], bth[buf[i++]], '-',
19
+ bth[buf[i++]], bth[buf[i++]],
20
+ bth[buf[i++]], bth[buf[i++]],
21
+ bth[buf[i++]], bth[buf[i++]]]).join('');
21
22
  }
22
23
 
23
24
  module.exports = bytesToUuid;
@@ -3,9 +3,11 @@
3
3
  // and inconsistent support for the `crypto` API. We do the best we can via
4
4
  // feature-detection
5
5
 
6
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
7
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||
8
- (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));
6
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto
7
+ // implementation. Also, find the complete implementation of crypto on IE11.
8
+ var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
9
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
10
+
9
11
  if (getRandomValues) {
10
12
  // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11
13
  var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
package/lib/v35.js CHANGED
@@ -43,7 +43,10 @@ module.exports = function(name, version, hashfunc) {
43
43
  return buf || bytesToUuid(bytes);
44
44
  };
45
45
 
46
- generateUUID.name = name;
46
+ // only attempt to set the name if's configurable (which it should be on node > 0.12)
47
+ if (Object.getOwnPropertyDescriptor(generateUUID, 'name').configurable) {
48
+ Object.defineProperty(generateUUID, 'name', {value: name});
49
+ }
47
50
 
48
51
  // Pre-defined namespaces, per Appendix C
49
52
  generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "uuid",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "RFC4122 (v1, v4, and v5) UUIDs",
5
+ "commitlint": {
6
+ "extends": [
7
+ "@commitlint/config-conventional"
8
+ ]
9
+ },
5
10
  "keywords": [
6
11
  "uuid",
7
12
  "guid",
@@ -12,12 +17,16 @@
12
17
  "uuid": "./bin/uuid"
13
18
  },
14
19
  "devDependencies": {
15
- "eslint": "4.5.0",
16
- "mocha": "3.1.2",
20
+ "@commitlint/cli": "7.0.0",
21
+ "@commitlint/config-conventional": "7.0.1",
22
+ "eslint": "4.19.1",
23
+ "husky": "0.14.3",
24
+ "mocha": "5.2.0",
17
25
  "runmd": "1.0.1",
18
- "standard-version": "4.2.0"
26
+ "standard-version": "4.4.0"
19
27
  },
20
28
  "scripts": {
29
+ "commitmsg": "commitlint -E GIT_PARAMS",
21
30
  "test": "mocha test/test.js",
22
31
  "md": "runmd --watch --output=README.md README_js.md",
23
32
  "release": "standard-version",
@@ -31,6 +40,5 @@
31
40
  "repository": {
32
41
  "type": "git",
33
42
  "url": "https://github.com/kelektiv/node-uuid.git"
34
- },
35
- "dependencies": {}
43
+ }
36
44
  }