uuidv4-gen

0.0.1 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i uuidv4-gen

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

1.51 kB

Total Files

3

Last publish

Collaborators

  • bakkot