Binary UUID generation

Issue #1 resolved
created an issue


I needed access to the raw, 16-byte UUID created by uuid_generate() so I modified the Generate function to accept an optional encoding parameter. A patch is attached. If you have time to review the patch and merge it in or provide similar functionality in a different way, I'd appreciate it.

Many thanks,


Comments (6)

  1. Nikhil Marathe repo owner

    I believe that the patch you have attached is incomplete, I see only the slight changes in the generate function, but I don't have your definitions of BINARY and ASCII and Export() etc. Please attach those.

    I would have to consider this, since returning the 16byte binary would make more sense returned as a Buffer than a string.

  2. weaver reporter

    Hi Nikhil,

    Thanks for the quick response. The definitions of BINARY, ASCII, and Encode() are part of Node (node.h and

    I considered using a Buffer, but implemented it using Encode(..., BINARY) in an effort to mimic methods in Node's Crypto module (e.g. hash.digest(encoding)). I don't care very much; I'm happy to modify the patch if you prefer Buffers.

    Best wishes,


  3. Log in to comment