README
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);