New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ynn-ms-idalloc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ynn-ms-idalloc

Ynn micro-service module for ID allocation. Supported FlakeID and UUID.

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

ynn-ms-idalloc

Ynn micro-service module for ID allocation. Supported FlakeID and UUID.

Build Status Coverage Status Node Version License NPM Version NPM Download

Installation

$ npm install ynn-ms-idalloc --save

Usage

Starting as a indenpent service

$ npx ynn-ms-idalloc --port=3000

Using as a module

const Ynn = require( 'ynn' );
const app = new Ynn( {
    root : __dirname,
    modules : {
        id : {
            path : 'ynn-ms-idalloc',
            config : { }
        }
    }
} );

Configuration items

flake Object

  • datacenter (5 bit) - datacenter identifier. It can have values from 0 to 31.
  • worker (5 bit) - worker identifier. It can have values from 0 to 31.
  • id (10 bit) - gnerator identifier. It can have values from 0 to 1023. It can be provided instead of datacenter and worker identifiers.
  • epoch - number used to reduce value of a generated timestamp. Note that this number should not exceed number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. It can be used to generate smaller ids.

Generating SnowFlake ID is using https://github.com/T-PWK/flake-idgen package.

API

/flake

To generate a SnowFlake ID.

/uuid/v1

To generate UUID version 1

/uuid/v3?name={name}&namespace={namespace}

To generate UUID version 3

/uuid/v4

To generate UUID version 4

/uuid/v5?name={name}&namespace={namespace}

Note: While generating UUID v3 and v5, the namespace can be a pre-defined namespace name in [ dns, url, oid, x500 ] defind in RFC4122. For example:

/uuid/v5?name={name}&namespace=url

To generate UUID version 5

Keywords

FAQs

Package last updated on 24 Feb 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc