Giter VIP home page Giter VIP logo

uuidv4's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ghandmann avatar goloroden avatar grundhoeferj avatar mearman avatar semantic-release-bot avatar yeldirium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uuidv4's Issues

uuidv3s pass as valid

I've just moved from 6.1.1 to 6.2.5 and now v3 UUIDs such as a3bb189e-8bf9-3888-9912-ace4e6543002 are passing as valid.

uuid.fromString is fundamentally flawed

The function fromString as found here: https://github.com/thenativeweb/uuidv4/blob/master/src/uuidv4.js#L24 is unfortunately fundamentally flawed and not up to RFC specifications.

A UUID v4 is supposed to be a cryptographically random generated UUID. fromString makes that entire specification moot and generates a UUID based of a string by cutting pieces the now deprecated sha1 hash, and due to UUID limitations, it can't use all of its 40 characters, opening up for further collisions.

warning with angular 10

converting my project to angular 10, now I get this warning

component.ts depends on uuidv4. CommonJS or AMD dependencies can cause optimization bailouts.

I am importing like this

import { uuid } from 'uuidv4';

how can I remove this warning ?

uuid collisions

Hi,
For some reason I notice that the uuids that are generated will repeat after a while. Is this natural to uuidv4 or is this an implementation problem?
The same results happen when run on nodejs v9.2.0 and v10.1.0. I have not tested this with other nodejs versions.

// Script
const uuid = require('uuidv4')

for (let i=0; i < 100000000000; i++) {
let str = uuid()
if (/^cacaca/g.test(str)) {
console.log(new Date(), str)
}
}

// Output
2018-06-11T14:01:17.878Z 'cacacab3-022d-48c8-9d9d-f05c42b5862a'
2018-06-11T14:02:35.680Z 'cacaca76-f041-4fcb-8ea1-3976147376c3'
2018-06-11T14:02:37.495Z 'cacaca07-b648-4ef2-9159-afa88c6a80f2'
2018-06-11T14:03:01.127Z 'cacacab3-022d-48c8-9d9d-f05c42b5862a'

Node 14.15.0 DeprecationWarning

I installed using $ npm i --save uuidv4. My test:

const { uuid } = require('uuidv4');
const my_uuid = uuid();
console.log(my_uuid); 

Output:

$ 3e394565-2f03-4cc6-a7d2-0d1f844138bf
$ (node:76250) DeprecationWarning: uuidv4() is deprecated. Use v4() from the uuid module instead.
$ (Use `node --trace-deprecation ...` to show where the warning was created)

Differences with `uuid`?

Hi! I'm one of the maintainers of the uuid module which is used as a dependency under the hood of this module.

I was made aware of this module due to a bug report (uuidjs/uuid#488) which ended up in the wrong repository.

With the upcoming [email protected] release we will be adding parse/stringify/validate/version methods as well as a NIL constant. So I was wondering what the remaining differences to this module would then still be? (Maybe JSON Schema?)

I just realized that many of the recent bug reports in this repo were actually just manifestations of upstream bugs, so maybe it would reduce overall maintenance burden if we simply merged the two modules together? BTW this has happened a few years ago already when we merged node-uuid and uuid into one module.

In any case I just wanted to let you know that we're always open for contributions at https://github.com/uuidjs/uuid If there is no interest from your end to consolidate the efforts then please just close this issue.

isUuid return true event if string is not a valid v4 uuid

Somewhere between version 6.1.0 and 6.2.4 isUuid was replaced by validate from uuid package.

However, the two functions are not equivalent.
Previous implementation of isUuid was validating that the 14th character was a '4' since this is a must for a valid uuid V4.
Implementation of validate does not do this check causing a backward incompatible change.

Maybe something to fix in uuid package ?

webpack 5 no longer include polyfills

Getting error:

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

This is using uuidv4 on nx workspaces.

TypeError: uuid is not a function

No idea what I am doing wrong here. I installed uuivv4 and it shows up in my package.json under dependencies: "uuidv4": "^6.2.6".
So in my NodeJS code, I import it and attempt to use it like so:

import uuid from 'uuidv4';
...
const clientID = uuid();

And I get the error: TypeError: uuid is not a function

Imports are broken since 6.0.8 on Node 13.5 and 13.6

I could not import this module for Node 13.5 or 13.6. It works on 13.7, 13.4 and 12.10.

Since 13.7 is already out, you might not care, so go ahead and close this. I'm reporting for posterity at least.

  • Windows 10 x64
  • Node 13.5.0, 13.6.0

6.0.7 is the last version that works for me.

On 6.0.8 - 6.1.1 it throws:

internal/modules/cjs/loader.js:625
  throw e;
  ^

Error: No valid exports main found for '...\node_modules\uuidv4\node_modules\uuid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (...\node_modules\uuidv4\build\lib\uuidv4.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30) {
  code: 'MODULE_NOT_FOUND'
}

On 6.1.1 - 6.2.0 it throws:

...\node_modules\uuidv4\node_modules\uuid\dist\esm-browser\index.js:1
export { default as v1 } from './v1.js';
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1055:16)
    at Module._compile (internal/modules/cjs/loader.js:1103:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (...\node_modules\uuidv4\build\lib\uuidv4.js:4:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)

uuidv4 won't work on react-native

issue

uuidv4 stops working on release builds of react-native.
The error occurs because crypto.getRandomValues is not provided out of the box in react-native in release mode.
When in debug mode it works since Chrome debugger comes with crypto.getRandomValues.

Reference issue: uuidjs/uuid#375

Update for Doc

Hello,
Please update the following lines on the docs.

Now working: import { uuid } from 'uuidv4';
Working: import uuid from 'uuidv4';

Thanks

uuid_prob
uuid_prob_02

Only way to import is destructuring { uuid }

Just switched over for the 90% size reduction from the plain UUID package, so thank you for giving us a great, slim package to use!

May be an edge case here, but the places my project uses uuid it is often putting that into an object by doing something like:

...
const uuid = uuidv4(); 
return { uuid, data };

With the current export signature of this module I either have to do some hacky things or change everywhere that I use uuids to nolonger use uuid as my own variable.

See PR here

No default export

Hi,

I just upgraded to the latest uuidv4, and ran into trouble when using it. After looking through the changeset, I see that you no longer have a default export. Is there a reason that the default export was removed? I'm working with a large codebase, and I'd like to keep things up to date with the latest version, but I'd have to change a very large number of files to refactor to use the named exports.

Thanks

uuidv4 return nan-undefinedundefined in browser

Steps:

  1. Install Angular 8
  2. Install uuid ^8.2.0
  3. Run project in development mode. Result is good (like 75442486-0878-440c-9db1-a7006c25a39f).
  4. Run project in production mode. Result is:

nan-undefinedundefined-undefinedundefined-undefinedundefined-undefinedundefinedundefinedundefinedundefinedundefined

uuidv4 requires uuid "3.3.3", which doesn't exist

Pretty much title. When running with yarn install, yarn can't find uuid v3.3.3 and asks to downgrade to 3.3.2, which is fine.

Running with npm install though it fails, because npm can't find uuid3.3.3 which is listed as a dependency of uuidv4.

Receving build error with 6.0.5 in expo

Seems like the additions of uuid v5 crashed compatibility with expo and maybe even react-native, the error message:

The package at "node_modules/uuidv4/node_modules/uuid/v5.js" attempted to import the Node standard library module "util". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo
Building JavaScript bundle: error

This error occurred after I updated from 6.0.2 to version 6.0.5.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.