Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: upgraded code to es6 standard #427

Merged
merged 14 commits into from May 2, 2020
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -56,7 +56,7 @@ uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'

```javascript
import { v1 as uuidv1 } from 'uuid';
uuidv1(); // ⇨ '29aedd50-8a1a-11ea-8bad-9b1deb4d3b7d'
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
```

### Create Version 3 or Version 5 (Namespace) UUIDs
Expand Down Expand Up @@ -202,16 +202,16 @@ Example: In-place generation of two binary IDs
const arr = new Array();
uuidv1(null, arr, 0); // ⇨
// [
// 41, 176, 99, 240, 138, 26,
// 17, 234, 146, 52, 155, 29,
// 44, 94, 164, 192, 64, 103,
// 17, 233, 146, 52, 155, 29,
// 235, 77, 59, 125
// ]
uuidv1(null, arr, 16); // ⇨
// [
// 41, 176, 99, 240, 138, 26, 17, 234,
// 146, 52, 155, 29, 235, 77, 59, 125,
// 41, 176, 99, 241, 138, 26, 17, 234,
// 146, 52, 155, 29, 235, 77, 59, 125
// 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
// ]
```

Expand Down
2 changes: 1 addition & 1 deletion src/v1.js
Expand Up @@ -48,7 +48,7 @@ function v1(options, buf, offset) {
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now();
let msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
awwit marked this conversation as resolved.
Show resolved Hide resolved

// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
Expand Down