Git Product home page Git Product logo

vuid's Introduction

vuid

very unique identifiers

This module exports a tiny (144B) function that generates UUIDv4 compliant identifiers in the browser. It takes advantages of and relies on the browsers built in crypto API namely the getRandomValues function. This offers a better level of randomness than Math.random but means will not work in a node environment.

For all practical purposes the generated identifiers can be considered universally unique. The chance of two ever colliding is 1 in 5,316,911,983,139,663,491,615,228,241,121,378,304. Which is a pretty cool guarantee.

For a history on the conception and evolution of this solution:

Import

You can install the package from npm and load it from node_modules.

import vuid from 'vuid'

Or import it directly from unpkg in a script tag where type="module".

import vuid from 'https://unpkg.com/vuid'

Usage

Call the imported function.

vuid() // 6dfc8a40-2d34-45b5-b3ab-aaf168e71aed

vuid's People

Contributors

lukejacksonn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.