Socket
Book a DemoInstallSign in
Socket

reason-uuid

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reason-uuid

BuckleScript bindings for node-uuid

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

Keywords

uuid

FAQs

Package last updated on 03 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts