1.0.0 • Published 4 years ago

reason-uuid v1.0.0

Weekly downloads
64
License
MIT
Repository
github
Last release
4 years ago

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)));
1.0.0

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago