Coder Social home page Coder Social logo

uuid's Introduction

uuid

This is the repository for the WICG uuid Specification. You're welcome to contribute!

Implementation status

Other runtimes

Usage example

const uuid = crypto.randomUUID();

Motivation

UUID generation is a common software requirement

The uuid library on npm currently receives 131,000,000 monthly downloads and is relied on by over 2,600,000 repositories (as of June 2019).

The ubiquitous nature of the uuid module demonstrates that UUID generation is a common requirement for JavaScript software applications, making the functionality a good candidate for the standard library.

Developers "re-inventing the wheel" is potentially harmful

Developers who have not been exposed to RFC4122 might naturally opt to invent their own approaches to UUID generation, potentially using Math.random().

There's an in-depth discussion of why a Cryptographically-Secure-Pseudo-Random-Number-Generator (CSPRNG) should be used when generating UUIDs. Of primary concern is that, without a high-quality source of randomness, collisions can frequently occur.

Introducing a UUID standard library, which dictates that a CSPRNG must be used, helps protect developers from security pitfalls.

Potential future work

Support for additional UUID formats

If compelling use cases are found for other UUID formats, the API might be extended to support them. If this is of interest to you, please join the discussion in issue #36.

Add isValidUUID method

In reviewing chromium#2804758, @mikewest suggested:

For the future: I wonder whether it's worth exposing WTF::IsValidUUID as well, as an analog to the uuid.validate() method in the UUID npm package?

It would be worth exploring if users would find exposing this method useful.

uuid's People

Contributors

bcoe avatar marcoscaceres avatar broofa avatar cwilso avatar domenic avatar sidvishnoi avatar

Watchers

 avatar

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.