reason-uuid

1.0.0 • Public • Published

reason-uuid

Bucklescript bindings for node-uuid.

NPM Version

Installation

npm install reason-uuid --save

Then add "reason-uuid" to the the bs-dependencies section of your bsconfig.json.

Usage

Version 1 (timestamp)

let uuid = Uuid.V1.make();

Version 3 (namespace)

/* Using predefined DNS namespace */
let uuid = Uuid.V3.make("hello.example.com", Uuid.Dns);
 
/* Using predefined URL namespace */
let uuid = Uuid.V3.make("http://example.com/hello", Uuid.Url);
 
/* Using a custom namespace */
let uuid = Uuid.V3.make("Hello, world!", Uuid.Custom("1b671a64-40d5-491e-99b0-da01ff1f3341"));

Version 4 (random)

let uuidv4 = Uuid.V4.make();

or

let uuidv4 = Uuid.make();

Version 5 (namespace)

/* Using predefined DNS namespace */
let uuidv5_1 = Uuid.V5.make("hello.example.com", Uuid.DNS);
 
/* Using predefined URL namespace */
let uuidv5_2 = Uuid.V5.make("http://example.com/hello", Uuid.URL);
 
/* Using a custom namespace */
let namespace = "1b671a64-40d5-491e-99b0-da01ff1f3341";
let uuidv5_3 = Uuid.V5.make("Hello, world!", Uuid.Custom(namespace)));

Package Sidebar

Install

npm i reason-uuid

Weekly Downloads

146

Version

1.0.0

License

MIT

Unpacked Size

3.68 kB

Total Files

7

Last publish

Collaborators

  • dean177