ismart-flake
ismart
Last updated 2 years ago by sbness .
ISC · Original npm · Tarball · package.json
$ cnpm install ismart-flake 
SYNC missed versions from official npm registry.

#ismart-flake

##config

path /.ismart/configs/smart.flake.idgen.json

{
        builder : {
            datacenter: 9,                          //不知道
            worker    : 7,                          //工作进程
            id        : 1,                          //ID
            epoch     : 10000000000000000,          //初始值
        },
        formater: {
            type   : "dec",                         //类型
            options: {
                format   : "BE",                    //大头朝上
                prefix   : "",                      //前缀
                groupsize: "",
                delimiter: "",
                padstr   : "",
                size     : "",
            }
        }
    }

##Useage

npm install ismart-flake --save

var iFlake = require("ismart-flake"); var myFlake = new iFlake(options);

var smartid = myFlake.next(); //默认smart.flake.idgen.json

or

var smartid = myFlake.int(); //纯数字

or

var smartid = myFlake.hex() //字符串

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |