Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uuidjs/uuid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ab33c8a77df180de1a12fede423490b3c2de9d07
Choose a base ref
...
head repository: uuidjs/uuid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3df73a98f07c0a38a94bcaf1ecde0e384dc3b126
Choose a head ref
  • 17 commits
  • 10 files changed
  • 2 contributors

Commits on Sep 1, 2019

  1. Remove wzrd.in from README (#323)

    * chore(doc): re-generate README
    
    * fix(doc): remove wzrd.in instruction from README
    
    The service wzrd.in seems to be unmaintained for over a year now, see
    browserify/wzrd.in@2f7ea69
    
    It currently throws 502 errors on all packages as reported in
    #302 or
    https://talk.observablehq.com/t/wzrd-in-alternatives/571
    
    As stated in
    #293 (comment)
    there are no plans to support legacy bundlers.
    
    Instead, we may consider to go for properly standardized ES6 modules in
    the future as has been teased in #317
    
    However for the time being let's at least remove these broken
    instructions from the README.
    
    Closes #176, #302
    ctavan authored and broofa committed Sep 1, 2019
    Copy the full SHA
    eea07e8 View commit details

Commits on Sep 23, 2019

  1. docs: re-generate README

    ctavan committed Sep 23, 2019
    Copy the full SHA
    b9fd85b View commit details

Commits on Oct 13, 2019

  1. test: remove tests on Node.js 6

    Node.js 6 has reached end-of-life at 2019-04-30 so there's little use of
    supporting this for future releases of uuid, see
    https://github.com/nodejs/Release#end-of-life-releases
    ctavan committed Oct 13, 2019
    Copy the full SHA
    edf430a View commit details
  2. Copy the full SHA
    b82ed2d View commit details
  3. Copy the full SHA
    bb2f9ae View commit details
  4. Copy the full SHA
    3bf178d View commit details
  5. Copy the full SHA
    2e9341f View commit details
  6. style: convert tabs to spaces

    ctavan committed Oct 13, 2019
    Copy the full SHA
    0c4638b View commit details
  7. Copy the full SHA
    b22219f View commit details
  8. Copy the full SHA
    acd26d6 View commit details
  9. Copy the full SHA
    d125e45 View commit details

Commits on Oct 25, 2019

  1. Merge pull request #335 from ctavan/prepare-for-esm

    Prepare for esm
    ctavan authored Oct 25, 2019
    Copy the full SHA
    60eb84a View commit details

Commits on Dec 4, 2019

  1. Bump eslint-utils from 1.4.0 to 1.4.2 (#324)

    Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
    - [Release notes](https://github.com/mysticatea/eslint-utils/releases)
    - [Commits](mysticatea/eslint-utils@v1.4.0...v1.4.2)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and broofa committed Dec 4, 2019
    Copy the full SHA
    0b141e1 View commit details

Commits on Dec 26, 2019

  1. Copy the full SHA
    ac7a3f4 View commit details

Commits on Dec 28, 2019

  1. Merge pull request #349 from kelektiv/dependabot/npm_and_yarn/handleb…

    …ars-4.5.3
    
    chore(deps): bump handlebars from 4.1.2 to 4.5.3
    ctavan authored Dec 28, 2019
    Copy the full SHA
    e444323 View commit details

Commits on Jan 16, 2020

  1. Copy the full SHA
    e2d7314 View commit details
  2. chore(release): 3.4.0

    ctavan committed Jan 16, 2020
    Copy the full SHA
    3df73a9 View commit details
Showing with 236 additions and 308 deletions.
  1. +5 −2 .eslintrc.json
  2. +1 −1 .travis.yml
  3. +25 −18 CHANGELOG.md
  4. +27 −44 README.md
  5. +0 −40 README_js.md
  6. +10 −8 lib/bytesToUuid.js
  7. +154 −184 package-lock.json
  8. +13 −8 package.json
  9. +0 −2 test/test.js
  10. +1 −1 v1.js
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -3,10 +3,13 @@
"env": {
"browser": true,
"commonjs": true,
"node": true,
"mocha": true
"mocha": true,
"node": true
},
"extends": ["eslint:recommended"],
"globals": {
"msCrypto": true
},
"rules": {
"array-bracket-spacing": ["warn", "never"],
"arrow-body-style": ["warn", "as-needed"],
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- "6"
- "8"
- "10"
- "12"
43 changes: 25 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,70 +2,77 @@

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.

### [3.3.3](https://github.com/kelektiv/node-uuid/compare/v3.3.2...v3.3.3) (2019-08-19)
## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16)


### Features

* rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338)

### [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19)

<a name="3.3.2"></a>
## [3.3.2](https://github.com/kelektiv/node-uuid/compare/v3.3.1...v3.3.2) (2018-06-28)
## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28)


### Bug Fixes

* typo ([305d877](https://github.com/kelektiv/node-uuid/commit/305d877))
* typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877))



<a name="3.3.1"></a>
## [3.3.1](https://github.com/kelektiv/node-uuid/compare/v3.3.0...v3.3.1) (2018-06-28)
## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28)


### Bug Fixes

* fix [#284](https://github.com/kelektiv/node-uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/kelektiv/node-uuid/commit/f2a60f2))
* fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2))



<a name="3.3.0"></a>
# [3.3.0](https://github.com/kelektiv/node-uuid/compare/v3.2.1...v3.3.0) (2018-06-22)
# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22)


### Bug Fixes

* 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))
* fix [#229](https://github.com/kelektiv/node-uuid/issues/229) ([c9684d4](https://github.com/kelektiv/node-uuid/commit/c9684d4))
* Get correct version of IE11 crypto ([#274](https://github.com/kelektiv/node-uuid/issues/274)) ([153d331](https://github.com/kelektiv/node-uuid/commit/153d331))
* mem issue when generating uuid ([#267](https://github.com/kelektiv/node-uuid/issues/267)) ([c47702c](https://github.com/kelektiv/node-uuid/commit/c47702c))
* assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc))
* fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4))
* Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331))
* mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c))

### Features

* enforce Conventional Commit style commit messages ([#282](https://github.com/kelektiv/node-uuid/issues/282)) ([cc9a182](https://github.com/kelektiv/node-uuid/commit/cc9a182))
* enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182))


<a name="3.2.1"></a>
## [3.2.1](https://github.com/kelektiv/node-uuid/compare/v3.2.0...v3.2.1) (2018-01-16)
## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16)


### Bug Fixes

* 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))
* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))



<a name="3.2.0"></a>
# [3.2.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.2.0) (2018-01-16)
# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16)


### Bug Fixes

* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/kelektiv/node-uuid/commit/09fa824))
* 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))
* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824))
* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))


### Features

* Add v3 Support ([#217](https://github.com/kelektiv/node-uuid/issues/217)) ([d94f726](https://github.com/kelektiv/node-uuid/commit/d94f726))
* Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726))


# [3.1.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.0.1) (2017-06-17)
# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17)

### Bug Fixes

71 changes: 27 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -80,46 +80,6 @@ uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614

```

## Quickstart - Browser-ready Versions

Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in).

For version 1 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv1@latest"></script>
<script>
uuidv1(); // -> v1 UUID
</script>
```

For version 3 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv3@latest"></script>
<script>
uuidv3('http://example.com/hello', uuidv3.URL); // -> v3 UUID
</script>
```

For version 4 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv4@latest"></script>
<script>
uuidv4(); // -> v4 UUID
</script>
```

For version 5 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv5@latest"></script>
<script>
uuidv5('http://example.com/hello', uuidv5.URL); // -> v5 UUID
</script>
```

## API

### Version 1
@@ -167,8 +127,19 @@ Example: In-place generation of two binary IDs
```javascript
// Generate two ids in an array
const arr = new Array();
uuidv1(null, arr, 0); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ]
uuidv1(null, arr, 16); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125, 44, 94, 164, 193, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ]
uuidv1(null, arr, 0); //
// [
// 44, 94, 164, 192, 64, 103,
// 17, 233, 146, 52, 155, 29,
// 235, 77, 59, 125
// ]
uuidv1(null, arr, 16); //
// [
// 44, 94, 164, 192, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125,
// 44, 94, 164, 193, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125
// ]

```

@@ -237,8 +208,20 @@ Example: Generate two IDs in a single buffer

```javascript
const buffer = new Array();
uuidv4(null, buffer, 0); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109 ]
uuidv4(null, buffer, 16); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109, 27, 157, 107, 205, 187, 253, 75, 45, 155, 93, 171, 141, 251, 189, 75, 237 ]
uuidv4(null, buffer, 0); //
// [
// 155, 29, 235, 77, 59,
// 125, 75, 173, 155, 221,
// 43, 13, 123, 61, 203,
// 109
// ]
uuidv4(null, buffer, 16); //
// [
// 155, 29, 235, 77, 59, 125, 75, 173,
// 155, 221, 43, 13, 123, 61, 203, 109,
// 27, 157, 107, 205, 187, 253, 75, 45,
// 155, 93, 171, 141, 251, 189, 75, 237
// ]

```

40 changes: 0 additions & 40 deletions README_js.md
Original file line number Diff line number Diff line change
@@ -89,46 +89,6 @@ const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
uuidv5('Hello, World!', MY_NAMESPACE); // RESULT
```

## Quickstart - Browser-ready Versions

Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in).

For version 1 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv1@latest"></script>
<script>
uuidv1(); // -> v1 UUID
</script>
```

For version 3 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv3@latest"></script>
<script>
uuidv3('http://example.com/hello', uuidv3.URL); // -> v3 UUID
</script>
```

For version 4 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv4@latest"></script>
<script>
uuidv4(); // -> v4 UUID
</script>
```

For version 5 uuids:

```html
<script src="http://wzrd.in/standalone/uuid%2Fv5@latest"></script>
<script>
uuidv5('http://example.com/hello', uuidv5.URL); // -> v5 UUID
</script>
```

## API

### Version 1
18 changes: 10 additions & 8 deletions lib/bytesToUuid.js
Original file line number Diff line number Diff line change
@@ -11,14 +11,16 @@ function bytesToUuid(buf, offset) {
var i = offset || 0;
var bth = byteToHex;
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
return ([bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]]]).join('');
return ([
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]]
]).join('');
}

module.exports = bytesToUuid;
338 changes: 154 additions & 184 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uuid",
"version": "3.3.3",
"version": "3.4.0",
"description": "RFC4122 (v1, v4, and v5) UUIDs",
"commitlint": {
"extends": [
@@ -17,17 +17,17 @@
"uuid": "./bin/uuid"
},
"devDependencies": {
"@commitlint/cli": "8.1.0",
"@commitlint/config-conventional": "8.1.0",
"eslint": "6.2.0",
"husky": "3.0.4",
"@commitlint/cli": "~8.2.0",
"@commitlint/config-conventional": "~8.2.0",
"eslint": "~6.4.0",
"husky": "~3.0.5",
"mocha": "6.2.0",
"runmd": "1.2.1",
"standard-version": "7.0.0"
},
"scripts": {
"commitmsg": "commitlint -E HUSKY_GIT_PARAMS",
"test": "mocha test/test.js",
"lint": "eslint .",
"test": "npm run lint && mocha test/test.js",
"md": "runmd --watch --output=README.md README_js.md",
"release": "standard-version",
"prepare": "runmd --output=README.md README_js.md"
@@ -39,6 +39,11 @@
},
"repository": {
"type": "git",
"url": "https://github.com/kelektiv/node-uuid.git"
"url": "https://github.com/uuidjs/uuid.git"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
2 changes: 0 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -73,8 +73,6 @@ test('mathRNG', function() {
});

test('cryptoRNG', function() {
var randomFillSync = crypto.randomFillSync;

Object.keys(require.cache).forEach(function(path) {
if (/rng-browser/.test(path)) delete require.cache[path];
});
2 changes: 1 addition & 1 deletion v1.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ var _clockseq;
var _lastMSecs = 0;
var _lastNSecs = 0;

// See https://github.com/broofa/node-uuid for API details
// See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || [];