fsevents 1.0.15 → 1.1.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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/fsevents.js +3 -0
- package/install.js +7 -0
- package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
- package/node_modules/abbrev/abbrev.js +0 -1
- package/node_modules/abbrev/package.json +32 -21
- package/node_modules/ansi-regex/index.js +1 -1
- package/node_modules/ansi-regex/package.json +61 -42
- package/node_modules/ansi-regex/readme.md +10 -2
- package/node_modules/ansi-styles/package.json +27 -19
- package/node_modules/aproba/README.md +33 -3
- package/node_modules/aproba/index.js +71 -30
- package/node_modules/aproba/package.json +30 -22
- package/node_modules/are-we-there-yet/package.json +14 -6
- package/node_modules/asn1/package.json +16 -8
- package/node_modules/assert-plus/package.json +16 -8
- package/node_modules/{node-uuid/LICENSE.md → asynckit/LICENSE} +1 -1
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +126 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/aws-sign2/package.json +15 -7
- package/node_modules/aws4/README.md +9 -0
- package/node_modules/aws4/aws4.js +21 -7
- package/node_modules/aws4/package.json +62 -54
- package/node_modules/balanced-match/package.json +27 -19
- package/node_modules/bcrypt-pbkdf/README.md +39 -0
- package/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/node_modules/bcrypt-pbkdf/package.json +84 -0
- package/node_modules/block-stream/package.json +15 -7
- package/node_modules/boom/package.json +14 -6
- package/node_modules/brace-expansion/index.js +10 -0
- package/node_modules/brace-expansion/package.json +35 -27
- package/node_modules/buffer-shims/package.json +16 -7
- package/node_modules/caseless/package.json +18 -10
- package/node_modules/chalk/package.json +30 -22
- package/node_modules/code-point-at/index.js +3 -4
- package/node_modules/code-point-at/package.json +40 -30
- package/node_modules/code-point-at/readme.md +2 -4
- package/node_modules/combined-stream/package.json +15 -7
- package/node_modules/commander/package.json +16 -8
- package/node_modules/concat-map/package.json +30 -22
- package/node_modules/console-control-strings/package.json +15 -7
- package/node_modules/core-util-is/package.json +22 -14
- package/node_modules/cryptiles/package.json +14 -6
- package/node_modules/dashdash/CHANGES.md +364 -0
- package/node_modules/dashdash/LICENSE.txt +24 -0
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +4 -3
- package/node_modules/dashdash/node_modules/assert-plus/package.json +16 -8
- package/node_modules/dashdash/package.json +33 -24
- package/node_modules/debug/package.json +20 -12
- package/node_modules/deep-extend/package.json +23 -15
- package/node_modules/delayed-stream/package.json +15 -7
- package/node_modules/delegates/package.json +14 -6
- package/node_modules/ecc-jsbn/package.json +17 -9
- package/node_modules/escape-string-regexp/package.json +20 -12
- package/node_modules/extend/package.json +16 -8
- package/node_modules/extsprintf/package.json +14 -6
- package/node_modules/forever-agent/package.json +15 -7
- package/node_modules/form-data/README.md +7 -8
- package/node_modules/form-data/lib/browser.js +1 -1
- package/node_modules/form-data/lib/form_data.js +101 -72
- package/node_modules/form-data/lib/populate.js +6 -5
- package/node_modules/form-data/package.json +68 -52
- package/node_modules/fs.realpath/package.json +19 -11
- package/node_modules/fstream/package.json +15 -7
- package/node_modules/fstream-ignore/package.json +15 -7
- package/node_modules/gauge/CHANGELOG.md +24 -0
- package/node_modules/gauge/README.md +4 -0
- package/node_modules/gauge/index.js +16 -9
- package/node_modules/gauge/package.json +37 -29
- package/node_modules/generate-function/package.json +16 -8
- package/node_modules/generate-object-property/package.json +14 -6
- package/node_modules/getpass/node_modules/assert-plus/package.json +16 -8
- package/node_modules/getpass/package.json +16 -8
- package/node_modules/glob/README.md +3 -0
- package/node_modules/glob/common.js +6 -1
- package/node_modules/glob/glob.js +23 -14
- package/node_modules/glob/package.json +29 -21
- package/node_modules/glob/sync.js +29 -11
- package/node_modules/graceful-fs/README.md +1 -1
- package/node_modules/graceful-fs/graceful-fs.js +23 -14
- package/node_modules/graceful-fs/package.json +35 -27
- package/node_modules/graceful-fs/polyfills.js +99 -21
- package/node_modules/graceful-readlink/package.json +14 -6
- package/node_modules/har-validator/package.json +16 -8
- package/node_modules/has-ansi/package.json +29 -21
- package/node_modules/has-unicode/package.json +18 -10
- package/node_modules/hawk/package.json +18 -10
- package/node_modules/hoek/package.json +14 -6
- package/node_modules/http-signature/package.json +14 -6
- package/node_modules/inflight/inflight.js +22 -12
- package/node_modules/inflight/package.json +28 -20
- package/node_modules/inherits/inherits.js +7 -1
- package/node_modules/inherits/package.json +41 -21
- package/node_modules/ini/package.json +15 -7
- package/node_modules/is-fullwidth-code-point/package.json +27 -19
- package/node_modules/is-my-json-valid/index.js +10 -0
- package/node_modules/is-my-json-valid/package.json +36 -20
- package/node_modules/is-my-json-valid/test/misc.js +24 -0
- package/node_modules/is-property/package.json +19 -11
- package/node_modules/is-typedarray/package.json +16 -8
- package/node_modules/isarray/package.json +28 -20
- package/node_modules/isstream/package.json +19 -11
- package/node_modules/jodid25519/package.json +18 -10
- package/node_modules/jsbn/index.js +8 -9
- package/node_modules/jsbn/package.json +30 -18
- package/node_modules/json-schema/lib/links.js +17 -3
- package/node_modules/json-schema/lib/validate.js +18 -5
- package/node_modules/json-schema/package.json +32 -18
- package/node_modules/json-stringify-safe/package.json +18 -10
- package/node_modules/{async/LICENSE → jsonpointer/LICENSE.md} +3 -1
- package/node_modules/jsonpointer/README.md +17 -10
- package/node_modules/jsonpointer/jsonpointer.js +73 -56
- package/node_modules/jsonpointer/package.json +47 -26
- package/node_modules/jsprim/CHANGES.md +4 -0
- package/node_modules/jsprim/package.json +25 -17
- package/node_modules/mime-db/HISTORY.md +50 -0
- package/node_modules/mime-db/db.json +126 -2
- package/node_modules/mime-db/package.json +43 -30
- package/node_modules/mime-types/HISTORY.md +19 -0
- package/node_modules/mime-types/index.js +8 -8
- package/node_modules/mime-types/package.json +32 -19
- package/node_modules/minimatch/minimatch.js +19 -20
- package/node_modules/minimatch/package.json +25 -17
- package/node_modules/minimist/package.json +24 -16
- package/node_modules/mkdirp/package.json +21 -13
- package/node_modules/ms/package.json +14 -6
- package/node_modules/node-pre-gyp/CHANGELOG.md +20 -0
- package/node_modules/node-pre-gyp/README.md +574 -0
- package/node_modules/node-pre-gyp/appveyor.yml +19 -9
- package/node_modules/node-pre-gyp/lib/install.js +31 -7
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +3 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +140 -0
- package/node_modules/node-pre-gyp/package.json +52 -48
- package/node_modules/nopt/package.json +19 -11
- package/node_modules/npmlog/CHANGELOG.md +9 -0
- package/node_modules/npmlog/README.md +7 -1
- package/node_modules/npmlog/log.js +12 -8
- package/node_modules/npmlog/package.json +30 -22
- package/node_modules/number-is-nan/package.json +39 -30
- package/node_modules/number-is-nan/readme.md +1 -3
- package/node_modules/oauth-sign/package.json +15 -7
- package/node_modules/object-assign/index.js +11 -4
- package/node_modules/object-assign/package.json +42 -30
- package/node_modules/object-assign/readme.md +8 -3
- package/node_modules/once/README.md +28 -0
- package/node_modules/once/once.js +21 -0
- package/node_modules/once/package.json +31 -20
- package/node_modules/path-is-absolute/index.js +5 -5
- package/node_modules/path-is-absolute/package.json +45 -31
- package/node_modules/path-is-absolute/readme.md +19 -11
- package/node_modules/pinkie/package.json +18 -10
- package/node_modules/pinkie-promise/package.json +18 -10
- package/node_modules/process-nextick-args/package.json +16 -8
- package/node_modules/punycode/LICENSE-MIT.txt +20 -0
- package/node_modules/punycode/README.md +176 -0
- package/node_modules/punycode/package.json +127 -0
- package/node_modules/punycode/punycode.js +533 -0
- package/node_modules/qs/.eslintrc +15 -15
- package/node_modules/qs/CHANGELOG.md +36 -0
- package/node_modules/qs/README.md +431 -0
- package/node_modules/qs/dist/qs.js +167 -67
- package/node_modules/qs/lib/formats.js +18 -0
- package/node_modules/qs/lib/index.js +6 -4
- package/node_modules/qs/lib/parse.js +31 -32
- package/node_modules/qs/lib/stringify.js +83 -20
- package/node_modules/qs/lib/utils.js +23 -7
- package/node_modules/qs/package.json +40 -30
- package/node_modules/qs/test/.eslintrc +10 -0
- package/node_modules/qs/test/index.js +2 -0
- package/node_modules/qs/test/parse.js +108 -47
- package/node_modules/qs/test/stringify.js +261 -28
- package/node_modules/qs/test/utils.js +13 -0
- package/node_modules/rc/node_modules/minimist/package.json +24 -16
- package/node_modules/rc/package.json +35 -23
- package/node_modules/readable-stream/.npmignore +1 -0
- package/node_modules/readable-stream/.travis.yml +2 -7
- package/node_modules/readable-stream/README.md +6 -2
- package/node_modules/readable-stream/lib/_stream_readable.js +158 -110
- package/node_modules/readable-stream/lib/_stream_transform.js +7 -5
- package/node_modules/readable-stream/lib/_stream_writable.js +35 -7
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/readable-stream/package.json +34 -26
- package/node_modules/request/CHANGELOG.md +49 -18
- package/node_modules/request/README.md +3 -2
- package/node_modules/request/index.js +2 -3
- package/node_modules/request/lib/auth.js +1 -1
- package/node_modules/request/lib/helpers.js +4 -13
- package/node_modules/request/lib/multipart.js +1 -1
- package/node_modules/request/lib/oauth.js +1 -1
- package/node_modules/request/lib/redirect.js +5 -1
- package/node_modules/request/package.json +50 -31
- package/node_modules/request/request.js +84 -43
- package/node_modules/rimraf/package.json +28 -20
- package/node_modules/rimraf/rimraf.js +2 -2
- package/node_modules/semver/README.md +4 -0
- package/node_modules/semver/package.json +27 -19
- package/node_modules/semver/semver.js +14 -5
- package/node_modules/set-blocking/package.json +21 -13
- package/node_modules/signal-exit/CHANGELOG.md +10 -0
- package/node_modules/signal-exit/LICENSE.txt +2 -0
- package/node_modules/signal-exit/index.js +9 -0
- package/node_modules/signal-exit/package.json +32 -24
- package/node_modules/signal-exit/signals.js +5 -4
- package/node_modules/sntp/package.json +16 -8
- package/node_modules/sshpk/README.md +214 -3
- package/node_modules/sshpk/bin/sshpk-conv +6 -0
- package/node_modules/sshpk/lib/certificate.js +291 -0
- package/node_modules/sshpk/lib/errors.js +14 -1
- package/node_modules/sshpk/lib/fingerprint.js +28 -7
- package/node_modules/sshpk/lib/formats/openssh-cert.js +289 -0
- package/node_modules/sshpk/lib/formats/pem.js +2 -2
- package/node_modules/sshpk/lib/formats/pkcs8.js +2 -7
- package/node_modules/sshpk/lib/formats/ssh-private.js +140 -17
- package/node_modules/sshpk/lib/formats/x509-pem.js +77 -0
- package/node_modules/sshpk/lib/formats/x509.js +484 -0
- package/node_modules/sshpk/lib/identity.js +277 -0
- package/node_modules/sshpk/lib/index.js +13 -1
- package/node_modules/sshpk/lib/key.js +1 -0
- package/node_modules/sshpk/lib/signature.js +14 -6
- package/node_modules/sshpk/lib/ssh-buffer.js +24 -0
- package/node_modules/sshpk/lib/utils.js +43 -1
- package/node_modules/sshpk/node_modules/assert-plus/package.json +16 -8
- package/node_modules/sshpk/package.json +32 -22
- package/node_modules/string-width/index.js +5 -0
- package/node_modules/string-width/package.json +49 -36
- package/node_modules/string-width/readme.md +4 -3
- package/node_modules/string_decoder/package.json +19 -11
- package/node_modules/stringstream/package.json +18 -10
- package/node_modules/strip-ansi/package.json +29 -21
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/package.json +49 -43
- package/node_modules/strip-json-comments/readme.md +12 -28
- package/node_modules/supports-color/package.json +26 -18
- package/node_modules/tar/package.json +19 -11
- package/node_modules/tar-pack/README.md +4 -1
- package/node_modules/tar-pack/index.js +17 -12
- package/node_modules/tar-pack/node_modules/once/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/once/README.md +51 -0
- package/node_modules/tar-pack/node_modules/once/once.js +21 -0
- package/node_modules/tar-pack/node_modules/once/package.json +96 -0
- package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +8 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/.travis.yml +4 -7
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/LICENSE +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/README.md +2 -2
- package/node_modules/tar-pack/node_modules/readable-stream/doc/stream.md +2015 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/duplex.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_duplex.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_passthrough.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_readable.js +164 -107
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_transform.js +3 -3
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_writable.js +25 -15
- package/node_modules/tar-pack/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/package.json +50 -30
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/passthrough.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/readable.js +4 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/transform.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/writable.js +0 -0
- package/node_modules/tar-pack/package.json +39 -22
- package/node_modules/tar-pack/test/index.js +43 -1
- package/node_modules/tough-cookie/README.md +17 -3
- package/node_modules/tough-cookie/lib/cookie.js +6 -12
- package/node_modules/tough-cookie/package.json +50 -35
- package/node_modules/tunnel-agent/package.json +15 -7
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +93 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +57 -61
- package/node_modules/tweetnacl/nacl-fast.js +22 -52
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.js +21 -51
- package/node_modules/tweetnacl/nacl.min.js +1 -1
- package/node_modules/tweetnacl/package.json +47 -46
- package/node_modules/uid-number/package.json +15 -7
- package/node_modules/util-deprecate/package.json +21 -13
- package/node_modules/uuid/.npmignore +8 -0
- package/node_modules/uuid/.travis.yml +5 -0
- package/node_modules/uuid/AUTHORS +5 -0
- package/node_modules/uuid/HISTORY.md +28 -0
- package/node_modules/uuid/LICENSE.md +21 -0
- package/node_modules/uuid/README.md +132 -0
- package/node_modules/{node-uuid → uuid}/bin/uuid +0 -0
- package/node_modules/uuid/index.js +8 -0
- package/node_modules/uuid/lib/bytesToUuid.js +23 -0
- package/node_modules/uuid/lib/rng-browser.js +33 -0
- package/node_modules/uuid/lib/rng.js +10 -0
- package/node_modules/uuid/package.json +122 -0
- package/node_modules/uuid/test/mocha.opts +3 -0
- package/node_modules/uuid/test/test.js +96 -0
- package/node_modules/uuid/v1.js +103 -0
- package/node_modules/uuid/v4.js +29 -0
- package/node_modules/verror/package.json +14 -6
- package/node_modules/wide-align/package.json +19 -11
- package/node_modules/wrappy/package.json +17 -8
- package/node_modules/xtend/package.json +29 -21
- package/package.json +2 -2
- package/node_modules/async/CHANGELOG.md +0 -125
- package/node_modules/async/README.md +0 -1877
- package/node_modules/async/dist/async.js +0 -1265
- package/node_modules/async/dist/async.min.js +0 -2
- package/node_modules/async/lib/async.js +0 -1265
- package/node_modules/async/package.json +0 -149
- package/node_modules/bl/.jshintrc +0 -59
- package/node_modules/bl/.npmignore +0 -1
- package/node_modules/bl/.travis.yml +0 -13
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -200
- package/node_modules/bl/bl.js +0 -243
- package/node_modules/bl/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/bl/node_modules/readable-stream/.zuul.yml +0 -1
- package/node_modules/bl/node_modules/readable-stream/doc/stream.markdown +0 -1760
- package/node_modules/bl/package.json +0 -96
- package/node_modules/bl/test/test.js +0 -640
- package/node_modules/form-data/.dockerignore +0 -7
- package/node_modules/form-data/.editorconfig +0 -10
- package/node_modules/form-data/.eslintignore +0 -1
- package/node_modules/form-data/.eslintrc +0 -64
- package/node_modules/form-data/wercker.yml +0 -36
- package/node_modules/gauge/CHANGELOG.md~ +0 -123
- package/node_modules/gauge/README.md~ +0 -393
- package/node_modules/has-color/index.js +0 -32
- package/node_modules/has-color/package.json +0 -97
- package/node_modules/has-color/readme.md +0 -30
- package/node_modules/inherits/test.js +0 -25
- package/node_modules/jsonpointer/.travis.yml +0 -10
- package/node_modules/jsonpointer/test.js +0 -98
- package/node_modules/node-uuid/.npmignore +0 -4
- package/node_modules/node-uuid/README.md +0 -254
- package/node_modules/node-uuid/benchmark/README.md +0 -53
- package/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- package/node_modules/node-uuid/benchmark/bench.sh +0 -34
- package/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
- package/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- package/node_modules/node-uuid/bower.json +0 -23
- package/node_modules/node-uuid/component.json +0 -25
- package/node_modules/node-uuid/package.json +0 -105
- package/node_modules/node-uuid/test/compare_v1.js +0 -63
- package/node_modules/node-uuid/test/test.html +0 -17
- package/node_modules/node-uuid/test/test.js +0 -231
- package/node_modules/node-uuid/uuid.js +0 -272
- package/node_modules/npmlog/CHANGELOG.md~ +0 -31
- package/node_modules/qs/.jscs.json +0 -176
- package/node_modules/qs/CONTRIBUTING.md +0 -1
- package/node_modules/readable-stream/doc/stream.md +0 -1772
- package/node_modules/request/.eslintrc +0 -45
- package/node_modules/request/.npmignore +0 -6
- package/node_modules/request/.travis.yml +0 -21
- package/node_modules/request/CONTRIBUTING.md +0 -81
- package/node_modules/request/codecov.yml +0 -2
- package/node_modules/strip-json-comments/cli.js +0 -41
- package/node_modules/strip-json-comments/strip-json-comments.js +0 -73
@@ -0,0 +1,132 @@
|
|
1
|
+
# uuid [](http://travis-ci.org/kelektiv/node-uuid) #
|
2
|
+
|
3
|
+
Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
|
4
|
+
|
5
|
+
Features:
|
6
|
+
|
7
|
+
* Generate RFC4122 version 1 or version 4 UUIDs
|
8
|
+
* Runs in node.js and browsers
|
9
|
+
* Cryptographically strong random number generation on supporting platforms
|
10
|
+
* Small footprint (Want something smaller? [Check this out](https://gist.github.com/982883)!)
|
11
|
+
|
12
|
+
## Quickstart - CommonJS (Recommended)
|
13
|
+
|
14
|
+
```shell
|
15
|
+
npm install uuid
|
16
|
+
```
|
17
|
+
|
18
|
+
```javascript
|
19
|
+
// Generate a v1 UUID (time-based)
|
20
|
+
const uuidV1 = require('uuid/v1');
|
21
|
+
uuidV1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
|
22
|
+
|
23
|
+
// Generate a v4 UUID (random)
|
24
|
+
const uuidV4 = require('uuid/v4');
|
25
|
+
uuidV4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
|
26
|
+
```
|
27
|
+
|
28
|
+
## Quickstart - Pre-packaged for browsers (Not recommended)
|
29
|
+
|
30
|
+
Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in).
|
31
|
+
|
32
|
+
```html
|
33
|
+
<script src="http://wzrd.in/standalone/uuid@latest"></script>
|
34
|
+
|
35
|
+
<script>
|
36
|
+
uuid.v1(); // -> v1 UUID
|
37
|
+
uuid.v4(); // -> v4 UUID
|
38
|
+
</script>
|
39
|
+
```
|
40
|
+
|
41
|
+
(Note: Do not do this in production. Just don't. wzrd.in is a great service, but if you're deploying a "real" service you should be using a packaging tool like browserify or webpack. If you do go this route you would be well advised to link to a specific version instead of `uuid@latest` to avoid having your code break when we roll out breaking changes.)
|
42
|
+
|
43
|
+
|
44
|
+
## API
|
45
|
+
|
46
|
+
### uuid(...)
|
47
|
+
|
48
|
+
Generate a V4 uuid. See uuid.v4 documentation below.
|
49
|
+
|
50
|
+
### uuid.v1([`options` [, `buffer` [, `offset`]]])
|
51
|
+
|
52
|
+
Generate and return a RFC4122 v1 (timestamp-based) UUID.
|
53
|
+
|
54
|
+
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
55
|
+
|
56
|
+
* `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
|
57
|
+
* `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
|
58
|
+
* `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.
|
59
|
+
* `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
|
60
|
+
|
61
|
+
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
62
|
+
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
63
|
+
|
64
|
+
Returns `buffer`, if specified, otherwise the string form of the UUID
|
65
|
+
|
66
|
+
Notes:
|
67
|
+
|
68
|
+
1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)
|
69
|
+
|
70
|
+
Example: Generate string UUID with fully-specified options
|
71
|
+
|
72
|
+
```javascript
|
73
|
+
uuid.v1({
|
74
|
+
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
75
|
+
clockseq: 0x1234,
|
76
|
+
msecs: new Date('2011-11-01').getTime(),
|
77
|
+
nsecs: 5678
|
78
|
+
}); // -> "710b962e-041c-11e1-9234-0123456789ab"
|
79
|
+
```
|
80
|
+
|
81
|
+
Example: In-place generation of two binary IDs
|
82
|
+
|
83
|
+
```javascript
|
84
|
+
// Generate two ids in an array
|
85
|
+
const arr = new Array(32); // -> []
|
86
|
+
uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
|
87
|
+
uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
|
88
|
+
```
|
89
|
+
|
90
|
+
### uuid.v4([`options` [, `buffer` [, `offset`]]])
|
91
|
+
|
92
|
+
Generate and return a RFC4122 v4 UUID.
|
93
|
+
|
94
|
+
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
95
|
+
|
96
|
+
* `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
|
97
|
+
* `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.
|
98
|
+
|
99
|
+
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
100
|
+
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
101
|
+
|
102
|
+
Returns `buffer`, if specified, otherwise the string form of the UUID
|
103
|
+
|
104
|
+
Example: Generate string UUID with fully-specified options
|
105
|
+
|
106
|
+
```javascript
|
107
|
+
uuid.v4({
|
108
|
+
random: [
|
109
|
+
0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
|
110
|
+
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
|
111
|
+
]
|
112
|
+
});
|
113
|
+
// -> "109156be-c4fb-41ea-b1b4-efe1671c5836"
|
114
|
+
```
|
115
|
+
|
116
|
+
Example: Generate two IDs in a single buffer
|
117
|
+
|
118
|
+
```javascript
|
119
|
+
const buffer = new Array(32); // (or 'new Buffer' in node.js)
|
120
|
+
uuid.v4(null, buffer, 0);
|
121
|
+
uuid.v4(null, buffer, 16);
|
122
|
+
```
|
123
|
+
|
124
|
+
## Testing
|
125
|
+
|
126
|
+
```
|
127
|
+
npm test
|
128
|
+
```
|
129
|
+
|
130
|
+
## Legacy node-uuid package
|
131
|
+
|
132
|
+
The code for the legacy node-uuid package is available in the `node-uuid` branch.
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
3
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
4
|
+
*/
|
5
|
+
var byteToHex = [];
|
6
|
+
for (var i = 0; i < 256; ++i) {
|
7
|
+
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
8
|
+
}
|
9
|
+
|
10
|
+
function bytesToUuid(buf, offset) {
|
11
|
+
var i = offset || 0;
|
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++]];
|
21
|
+
}
|
22
|
+
|
23
|
+
module.exports = bytesToUuid;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// Unique ID creation requires a high quality random # generator. In the
|
2
|
+
// browser this is a little complicated due to unknown quality of Math.random()
|
3
|
+
// and inconsistent support for the `crypto` API. We do the best we can via
|
4
|
+
// feature-detection
|
5
|
+
var rng;
|
6
|
+
|
7
|
+
var crypto = global.crypto || global.msCrypto; // for IE 11
|
8
|
+
if (crypto && crypto.getRandomValues) {
|
9
|
+
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
10
|
+
var rnds8 = new Uint8Array(16);
|
11
|
+
rng = function whatwgRNG() {
|
12
|
+
crypto.getRandomValues(rnds8);
|
13
|
+
return rnds8;
|
14
|
+
};
|
15
|
+
}
|
16
|
+
|
17
|
+
if (!rng) {
|
18
|
+
// Math.random()-based (RNG)
|
19
|
+
//
|
20
|
+
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
21
|
+
// quality.
|
22
|
+
var rnds = new Array(16);
|
23
|
+
rng = function() {
|
24
|
+
for (var i = 0, r; i < 16; i++) {
|
25
|
+
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
26
|
+
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
27
|
+
}
|
28
|
+
|
29
|
+
return rnds;
|
30
|
+
};
|
31
|
+
}
|
32
|
+
|
33
|
+
module.exports = rng;
|
@@ -0,0 +1,122 @@
|
|
1
|
+
{
|
2
|
+
"_args": [
|
3
|
+
[
|
4
|
+
{
|
5
|
+
"raw": "uuid@^3.0.0",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "uuid",
|
8
|
+
"name": "uuid",
|
9
|
+
"rawSpec": "^3.0.0",
|
10
|
+
"spec": ">=3.0.0 <4.0.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
13
|
+
"/Users/eshanker/Code/fsevents/node_modules/request"
|
14
|
+
]
|
15
|
+
],
|
16
|
+
"_from": "uuid@>=3.0.0 <4.0.0",
|
17
|
+
"_id": "uuid@3.0.1",
|
18
|
+
"_inCache": true,
|
19
|
+
"_location": "/uuid",
|
20
|
+
"_nodeVersion": "6.7.0",
|
21
|
+
"_npmOperationalInternal": {
|
22
|
+
"host": "packages-12-west.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/uuid-3.0.1.tgz_1480403886767_0.2584113120101392"
|
24
|
+
},
|
25
|
+
"_npmUser": {
|
26
|
+
"name": "defunctzombie",
|
27
|
+
"email": "shtylman@gmail.com"
|
28
|
+
},
|
29
|
+
"_npmVersion": "3.10.3",
|
30
|
+
"_phantomChildren": {},
|
31
|
+
"_requested": {
|
32
|
+
"raw": "uuid@^3.0.0",
|
33
|
+
"scope": null,
|
34
|
+
"escapedName": "uuid",
|
35
|
+
"name": "uuid",
|
36
|
+
"rawSpec": "^3.0.0",
|
37
|
+
"spec": ">=3.0.0 <4.0.0",
|
38
|
+
"type": "range"
|
39
|
+
},
|
40
|
+
"_requiredBy": [
|
41
|
+
"/request"
|
42
|
+
],
|
43
|
+
"_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz",
|
44
|
+
"_shasum": "6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1",
|
45
|
+
"_shrinkwrap": null,
|
46
|
+
"_spec": "uuid@^3.0.0",
|
47
|
+
"_where": "/Users/eshanker/Code/fsevents/node_modules/request",
|
48
|
+
"bin": {
|
49
|
+
"uuid": "./bin/uuid"
|
50
|
+
},
|
51
|
+
"browser": {
|
52
|
+
"./lib/rng.js": "./lib/rng-browser.js"
|
53
|
+
},
|
54
|
+
"bugs": {
|
55
|
+
"url": "https://github.com/kelektiv/node-uuid/issues"
|
56
|
+
},
|
57
|
+
"contributors": [
|
58
|
+
{
|
59
|
+
"name": "Robert Kieffer",
|
60
|
+
"email": "robert@broofa.com"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name": "Christoph Tavan",
|
64
|
+
"email": "dev@tavan.de"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"name": "AJ ONeal",
|
68
|
+
"email": "coolaj86@gmail.com"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "Vincent Voyer",
|
72
|
+
"email": "vincent@zeroload.net"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"name": "Roman Shtylman",
|
76
|
+
"email": "shtylman@gmail.com"
|
77
|
+
}
|
78
|
+
],
|
79
|
+
"dependencies": {},
|
80
|
+
"description": "RFC4122 (v1 and v4) generator",
|
81
|
+
"devDependencies": {
|
82
|
+
"mocha": "3.1.2"
|
83
|
+
},
|
84
|
+
"directories": {},
|
85
|
+
"dist": {
|
86
|
+
"shasum": "6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1",
|
87
|
+
"tarball": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz"
|
88
|
+
},
|
89
|
+
"gitHead": "374de826de71d8997f71b4641f65552e48956ced",
|
90
|
+
"homepage": "https://github.com/kelektiv/node-uuid#readme",
|
91
|
+
"keywords": [
|
92
|
+
"uuid",
|
93
|
+
"guid",
|
94
|
+
"rfc4122"
|
95
|
+
],
|
96
|
+
"license": "MIT",
|
97
|
+
"maintainers": [
|
98
|
+
{
|
99
|
+
"name": "broofa",
|
100
|
+
"email": "robert@broofa.com"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"name": "defunctzombie",
|
104
|
+
"email": "shtylman@gmail.com"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"name": "vvo",
|
108
|
+
"email": "vincent.voyer@gmail.com"
|
109
|
+
}
|
110
|
+
],
|
111
|
+
"name": "uuid",
|
112
|
+
"optionalDependencies": {},
|
113
|
+
"readme": "ERROR: No README data found!",
|
114
|
+
"repository": {
|
115
|
+
"type": "git",
|
116
|
+
"url": "git+https://github.com/kelektiv/node-uuid.git"
|
117
|
+
},
|
118
|
+
"scripts": {
|
119
|
+
"test": "mocha test/test.js"
|
120
|
+
},
|
121
|
+
"version": "3.0.1"
|
122
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
var assert = require('assert');
|
2
|
+
|
3
|
+
var uuid = require('../');
|
4
|
+
|
5
|
+
// Verify ordering of v1 ids created with explicit times
|
6
|
+
var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00
|
7
|
+
|
8
|
+
function compare(name, ids) {
|
9
|
+
test(name, function() {
|
10
|
+
// avoid .map for older browsers
|
11
|
+
for (var i=0 ; i<ids.length ; ++i) {
|
12
|
+
ids[i] = ids[i].split('-').reverse().join('-');
|
13
|
+
}
|
14
|
+
ids = ids.sort();
|
15
|
+
var sorted = ([].concat(ids)).sort();
|
16
|
+
|
17
|
+
assert(sorted.toString() == ids.toString(), name + ' have expected order');
|
18
|
+
});
|
19
|
+
}
|
20
|
+
|
21
|
+
// Verify ordering of v1 ids created using default behavior
|
22
|
+
compare('uuids with current time', [
|
23
|
+
uuid.v1(),
|
24
|
+
uuid.v1(),
|
25
|
+
uuid.v1(),
|
26
|
+
uuid.v1(),
|
27
|
+
uuid.v1()
|
28
|
+
]);
|
29
|
+
|
30
|
+
// Verify ordering of v1 ids created with explicit times
|
31
|
+
compare('uuids with time option', [
|
32
|
+
uuid.v1({msecs: TIME - 10*3600*1000}),
|
33
|
+
uuid.v1({msecs: TIME - 1}),
|
34
|
+
uuid.v1({msecs: TIME}),
|
35
|
+
uuid.v1({msecs: TIME + 1}),
|
36
|
+
uuid.v1({msecs: TIME + 28*24*3600*1000})
|
37
|
+
]);
|
38
|
+
|
39
|
+
test('msec', function() {
|
40
|
+
assert(
|
41
|
+
uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}),
|
42
|
+
'IDs created at same msec are different'
|
43
|
+
);
|
44
|
+
});
|
45
|
+
|
46
|
+
test('exception thrown when > 10k ids created in 1ms', function() {
|
47
|
+
// Verify throw if too many ids created
|
48
|
+
var thrown = false;
|
49
|
+
try {
|
50
|
+
uuid.v1({msecs: TIME, nsecs: 10000});
|
51
|
+
} catch (e) {
|
52
|
+
thrown = true;
|
53
|
+
}
|
54
|
+
assert(thrown, 'Exception thrown when > 10K ids created in 1 ms');
|
55
|
+
});
|
56
|
+
|
57
|
+
test('clock regression by msec', function() {
|
58
|
+
// Verify clock regression bumps clockseq
|
59
|
+
var uidt = uuid.v1({msecs: TIME});
|
60
|
+
var uidtb = uuid.v1({msecs: TIME - 1});
|
61
|
+
assert(
|
62
|
+
parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1,
|
63
|
+
'Clock regression by msec increments the clockseq'
|
64
|
+
);
|
65
|
+
});
|
66
|
+
|
67
|
+
test('clock regression by nsec', function() {
|
68
|
+
// Verify clock regression bumps clockseq
|
69
|
+
var uidtn = uuid.v1({msecs: TIME, nsecs: 10});
|
70
|
+
var uidtnb = uuid.v1({msecs: TIME, nsecs: 9});
|
71
|
+
assert(
|
72
|
+
parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1,
|
73
|
+
'Clock regression by nsec increments the clockseq'
|
74
|
+
);
|
75
|
+
});
|
76
|
+
|
77
|
+
test('explicit options product expected id', function() {
|
78
|
+
// Verify explicit options produce expected id
|
79
|
+
var id = uuid.v1({
|
80
|
+
msecs: 1321651533573,
|
81
|
+
nsecs: 5432,
|
82
|
+
clockseq: 0x385c,
|
83
|
+
node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ]
|
84
|
+
});
|
85
|
+
assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id');
|
86
|
+
});
|
87
|
+
|
88
|
+
test('ids spanning 1ms boundary are 100ns apart', function() {
|
89
|
+
// Verify adjacent ids across a msec boundary are 1 time unit apart
|
90
|
+
var u0 = uuid.v1({msecs: TIME, nsecs: 9999});
|
91
|
+
var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0});
|
92
|
+
|
93
|
+
var before = u0.split('-')[0], after = u1.split('-')[0];
|
94
|
+
var dt = parseInt(after, 16) - parseInt(before, 16);
|
95
|
+
assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart');
|
96
|
+
});
|
@@ -0,0 +1,103 @@
|
|
1
|
+
// Unique ID creation requires a high quality random # generator. We feature
|
2
|
+
// detect to determine the best RNG source, normalizing to a function that
|
3
|
+
// returns 128-bits of randomness, since that's what's usually required
|
4
|
+
var rng = require('./lib/rng');
|
5
|
+
var bytesToUuid = require('./lib/bytesToUuid');
|
6
|
+
|
7
|
+
// **`v1()` - Generate time-based UUID**
|
8
|
+
//
|
9
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
10
|
+
// and http://docs.python.org/library/uuid.html
|
11
|
+
|
12
|
+
// random #'s we need to init node and clockseq
|
13
|
+
var _seedBytes = rng();
|
14
|
+
|
15
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
16
|
+
var _nodeId = [
|
17
|
+
_seedBytes[0] | 0x01,
|
18
|
+
_seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
|
19
|
+
];
|
20
|
+
|
21
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
22
|
+
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
|
23
|
+
|
24
|
+
// Previous uuid creation time
|
25
|
+
var _lastMSecs = 0, _lastNSecs = 0;
|
26
|
+
|
27
|
+
// See https://github.com/broofa/node-uuid for API details
|
28
|
+
function v1(options, buf, offset) {
|
29
|
+
var i = buf && offset || 0;
|
30
|
+
var b = buf || [];
|
31
|
+
|
32
|
+
options = options || {};
|
33
|
+
|
34
|
+
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
35
|
+
|
36
|
+
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
37
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
38
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
39
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
40
|
+
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
41
|
+
|
42
|
+
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
43
|
+
// cycle to simulate higher resolution clock
|
44
|
+
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
45
|
+
|
46
|
+
// Time since last uuid creation (in msecs)
|
47
|
+
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
|
48
|
+
|
49
|
+
// Per 4.2.1.2, Bump clockseq on clock regression
|
50
|
+
if (dt < 0 && options.clockseq === undefined) {
|
51
|
+
clockseq = clockseq + 1 & 0x3fff;
|
52
|
+
}
|
53
|
+
|
54
|
+
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
55
|
+
// time interval
|
56
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
57
|
+
nsecs = 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
// Per 4.2.1.2 Throw error if too many uuids are requested
|
61
|
+
if (nsecs >= 10000) {
|
62
|
+
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
63
|
+
}
|
64
|
+
|
65
|
+
_lastMSecs = msecs;
|
66
|
+
_lastNSecs = nsecs;
|
67
|
+
_clockseq = clockseq;
|
68
|
+
|
69
|
+
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
70
|
+
msecs += 12219292800000;
|
71
|
+
|
72
|
+
// `time_low`
|
73
|
+
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
74
|
+
b[i++] = tl >>> 24 & 0xff;
|
75
|
+
b[i++] = tl >>> 16 & 0xff;
|
76
|
+
b[i++] = tl >>> 8 & 0xff;
|
77
|
+
b[i++] = tl & 0xff;
|
78
|
+
|
79
|
+
// `time_mid`
|
80
|
+
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
81
|
+
b[i++] = tmh >>> 8 & 0xff;
|
82
|
+
b[i++] = tmh & 0xff;
|
83
|
+
|
84
|
+
// `time_high_and_version`
|
85
|
+
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
86
|
+
b[i++] = tmh >>> 16 & 0xff;
|
87
|
+
|
88
|
+
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
89
|
+
b[i++] = clockseq >>> 8 | 0x80;
|
90
|
+
|
91
|
+
// `clock_seq_low`
|
92
|
+
b[i++] = clockseq & 0xff;
|
93
|
+
|
94
|
+
// `node`
|
95
|
+
var node = options.node || _nodeId;
|
96
|
+
for (var n = 0; n < 6; ++n) {
|
97
|
+
b[i + n] = node[n];
|
98
|
+
}
|
99
|
+
|
100
|
+
return buf ? buf : bytesToUuid(b);
|
101
|
+
}
|
102
|
+
|
103
|
+
module.exports = v1;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var rng = require('./lib/rng');
|
2
|
+
var bytesToUuid = require('./lib/bytesToUuid');
|
3
|
+
|
4
|
+
function v4(options, buf, offset) {
|
5
|
+
var i = buf && offset || 0;
|
6
|
+
|
7
|
+
if (typeof(options) == 'string') {
|
8
|
+
buf = options == 'binary' ? new Array(16) : null;
|
9
|
+
options = null;
|
10
|
+
}
|
11
|
+
options = options || {};
|
12
|
+
|
13
|
+
var rnds = options.random || (options.rng || rng)();
|
14
|
+
|
15
|
+
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
16
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
17
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
18
|
+
|
19
|
+
// Copy bytes to buffer, if provided
|
20
|
+
if (buf) {
|
21
|
+
for (var ii = 0; ii < 16; ++ii) {
|
22
|
+
buf[i + ii] = rnds[ii];
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
return buf || bytesToUuid(rnds);
|
27
|
+
}
|
28
|
+
|
29
|
+
module.exports = v4;
|
@@ -1,26 +1,34 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"raw": "verror@1.3.6",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "verror",
|
8
|
+
"name": "verror",
|
9
|
+
"rawSpec": "1.3.6",
|
10
|
+
"spec": "1.3.6",
|
11
|
+
"type": "version"
|
12
|
+
},
|
5
13
|
"/Users/eshanker/Code/fsevents/node_modules/jsprim"
|
6
14
|
]
|
7
15
|
],
|
8
16
|
"_from": "verror@1.3.6",
|
9
17
|
"_id": "verror@1.3.6",
|
10
18
|
"_inCache": true,
|
11
|
-
"_installable": true,
|
12
19
|
"_location": "/verror",
|
13
20
|
"_npmUser": {
|
14
|
-
"
|
15
|
-
"
|
21
|
+
"name": "dap",
|
22
|
+
"email": "dap@cs.brown.edu"
|
16
23
|
},
|
17
24
|
"_npmVersion": "1.1.65",
|
18
25
|
"_phantomChildren": {},
|
19
26
|
"_requested": {
|
20
|
-
"name": "verror",
|
21
27
|
"raw": "verror@1.3.6",
|
22
|
-
"rawSpec": "1.3.6",
|
23
28
|
"scope": null,
|
29
|
+
"escapedName": "verror",
|
30
|
+
"name": "verror",
|
31
|
+
"rawSpec": "1.3.6",
|
24
32
|
"spec": "1.3.6",
|
25
33
|
"type": "version"
|
26
34
|
},
|
@@ -1,27 +1,35 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"raw": "wide-align@^1.1.0",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "wide-align",
|
8
|
+
"name": "wide-align",
|
9
|
+
"rawSpec": "^1.1.0",
|
10
|
+
"spec": ">=1.1.0 <2.0.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
5
13
|
"/Users/eshanker/Code/fsevents/node_modules/gauge"
|
6
14
|
]
|
7
15
|
],
|
8
16
|
"_from": "wide-align@>=1.1.0 <2.0.0",
|
9
17
|
"_id": "wide-align@1.1.0",
|
10
18
|
"_inCache": true,
|
11
|
-
"_installable": true,
|
12
19
|
"_location": "/wide-align",
|
13
20
|
"_nodeVersion": "4.2.2",
|
14
21
|
"_npmUser": {
|
15
|
-
"
|
16
|
-
"
|
22
|
+
"name": "iarna",
|
23
|
+
"email": "me@re-becca.org"
|
17
24
|
},
|
18
25
|
"_npmVersion": "3.5.3",
|
19
26
|
"_phantomChildren": {},
|
20
27
|
"_requested": {
|
21
|
-
"name": "wide-align",
|
22
28
|
"raw": "wide-align@^1.1.0",
|
23
|
-
"rawSpec": "^1.1.0",
|
24
29
|
"scope": null,
|
30
|
+
"escapedName": "wide-align",
|
31
|
+
"name": "wide-align",
|
32
|
+
"rawSpec": "^1.1.0",
|
25
33
|
"spec": ">=1.1.0 <2.0.0",
|
26
34
|
"type": "range"
|
27
35
|
},
|
@@ -34,8 +42,8 @@
|
|
34
42
|
"_spec": "wide-align@^1.1.0",
|
35
43
|
"_where": "/Users/eshanker/Code/fsevents/node_modules/gauge",
|
36
44
|
"author": {
|
37
|
-
"email": "me@re-becca.org",
|
38
45
|
"name": "Rebecca Turner",
|
46
|
+
"email": "me@re-becca.org",
|
39
47
|
"url": "http://re-becca.org/"
|
40
48
|
},
|
41
49
|
"bugs": {
|
@@ -56,12 +64,12 @@
|
|
56
64
|
"gitHead": "fe3f7f210650913d5bee702d7e19938f6977bc8a",
|
57
65
|
"homepage": "https://github.com/iarna/wide-align#readme",
|
58
66
|
"keywords": [
|
59
|
-
"
|
60
|
-
"cjkv",
|
67
|
+
"wide",
|
61
68
|
"double",
|
62
|
-
"pad",
|
63
69
|
"unicode",
|
64
|
-
"
|
70
|
+
"cjkv",
|
71
|
+
"pad",
|
72
|
+
"align"
|
65
73
|
],
|
66
74
|
"license": "ISC",
|
67
75
|
"main": "align.js",
|