Uniqueness and Randomness combined
Using UUID library, combining Uniqueness(uuidv1) and Randomness(uuidv4), trying to get randomly unique solution to generate universally unique identifier.
npm install uuid-extra
First extra function which combines the uuidv1
and uuidv4
output and uses Math.random
for selecting bits and generates
const uuidex = require('uuid-extra');
console.log(`EX14: ${uuidex.ex14()}`);
Original uuidv1
function
const uuidex = require('uuid-extra');
console.log(`V1: ${uuidex.v1()}`);
Original uuidv4
function
const uuidex = require('uuid-extra');
console.log(`V4: ${uuidex.v4()}`);
Note: All the credits goes to original UUID [Github, NPM] for such useful module.