These libuuid bindings are forked from Nikhil Marathe's project on bitbucket.
Clone this repository, then:
cd uuidjs
node-waf configure build
and link build/default/uuid.node
into your NODE_PATH
.
var sys = require('sys'),
uuid = require('uuid');
sys.puts('generate: ' + uuid.generate());
sys.puts('binary: ' + sys.inspect(uuid.generate('binary')));
generate([encoding])
Generate a new UUID with an optional encoding. If the encoding is
'binary'
, return the raw, 16 byte UUID. Otherwise, return a 40
character string in a hyphenated hexidecimal format.