0.0.3 • Published 8 years ago
u-uuid-js v0.0.3
u-uuid-js
A 'micro' GUID/UUID implementation based on RFC 4122.
Prerequisites
- NodeJs / NPM
 
Installation
  npm i --save 'u-uuid-js'Testing
From your application code.
  const uUUID = require('u-uuid-js')
  const myThing.id = uUUID.createV1([options [, buffer [, offset]]])
  console.log('myUUID --> ', myUUID)Usage / API
This repo is under development. Initial LTS release will be 1.0.0, and it should not be used until then. That said...
uUUID.createV1([options [, buffer , offset]])
Generate and return an RFC4122 v1 (time-based) UUID.
options- (Object) Optional:node- (Array) Node id; 6 bytesclockseq- (Number 0 - 0x3fff) RFC clock sequencemsecs- (Number | Date) Time in milliseconds since unix Epochnsecs- (Number 0 - 9999) additional time, in 100-nanosecond units
buffer- (Array | Buffer) Array or Buffer where UUID bytes are to be writtenoffset- (Number) Buffer index at which to begin writing
Returns UUID string (|| buffer if specified)
Example: Generate string UUID with fully-specified options JavaScript
uuid.v1({
  node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
  clockseq: 0x1234,
  msecs: new Date('2011-11-01').getTime(),
  nsecs: 5678
})Contributing
Not currently accepting outside contributors, but feel free to clone, modify and use as you wish.
Authors
License
This project is licensed under the DO_WHATEVER_YOU_WANT License - see the LICENSE file for details
Acknowledgments
- Gayle Laakmann McDowell --- HackerRank YouTube