RFC4122 Compliant UUIDs for node & HTML5 browsers w/ "real" entropy & hash functions
  • JavaScript 81.7%
  • HTML 18.3%
Find a file
Meadhbh Hamrick 5c294cd098 initial commit
2013-04-09 15:37:13 -07:00
example initial commit 2013-04-09 15:37:13 -07:00
test initial commit 2013-04-09 15:37:13 -07:00
LICENSE initial commit 2013-04-09 15:37:13 -07:00
nodify-uuid.js initial commit 2013-04-09 15:37:13 -07:00
package.json initial commit 2013-04-09 15:37:13 -07:00
README.md initial commit 2013-04-09 15:37:13 -07:00

nodify-uuid

RFC4122 Compliant UUIDs for node & HTML5 browsers w/ "real" entropy & hash functions

Introduction

  • Generates hash-based and random RFC 4122 Compliant UUIDs
  • Actually generates MD5 & SHA1 UUIDs correctly
  • Uses strong crypto and "real" entropy if available. if not, fails safe
  • Works in Node.JS & HTML5 browsers

API

To generate a Random UUID, do the following:

  • include the nodify-uuid package
  • call the .generate() method specifying the V_RANDOM version and a callback

Example:

    var uuid = require( 'node-uuid' );
    uuid.generate( uuid.V_RANDOM, function( err, u ) {
      console.log( (err?err:u).toString() );
    }

To generate a MD5 or SHA1 name-based UUID, do the following:

  • include the nodify-uuid package
  • call the .generate() method specifying the V_MD5 (or V_SHA1) type, the namespace UUID, the name and a callback

Example:

    var uuid = require( 'node-uuid' );
    uuid.generate( uuid.V_MD5. uuid.NS_DNS, "github.com", uuid.function( err, u ) {
      console.log( (err?err:u).toString() );
    }