Skip to content
Generate UUIDv4 strings in JavaScript
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
index.js
package-lock.json
package.json
test.js

README.md

uuidv4-gen

A very simple library for generating RFC 4122 UUIDs, variant 4, given a source of randomness.

Usage

On the web:

let uuidv4 = require('uuidv4-gen');

let uuid = uuidv4(crypto.getRandomValues.bind(crypto));

In node:

let uuidv4 = require('uuidv4-gen');
let crypto = require('crypto');
function getRandomBytes(buffer) {
  buffer.set(crypto.randomBytes(buffer.length));
}

let uuid = uuidv4(getRandomBytes);
You can’t perform that action at this time.