dwing-common
v1.0.8
Published
Node.js 通用类
Downloads
4
Readme
dwing-Common
安装
npm install dwing-common --save
使用
ES7:
import {md5} from 'dwing-common';
console.log(md5('1'));
Methods
getDefer() → {Promise.defer}
getDefer
Returns:
defer对象
getTimestamp() → {int}
获取UNIX标准时间戳
Returns:
UNIX标准时间戳
int2ip(num) → {string}
INT2IP
Parameters:
IP数值
Returns:
IP地址,如1.2.3.4
ip2int(ip) → {number}
IP2INT
Parameters:
IP地址,如1.2.3.4
Returns:
IP数值
isEmpty(obj) → {boolean}
判断是否为空
Parameters:
任意
Returns:
真为空,假为非空
md5(str) → {string}
MD5
Parameters:
Returns:
randStr(len) → {string}
随机字符串
Parameters:
字符串长度
Returns:
sha1(str) → {string}
SHA1
Parameters:
Returns:
sha1(str) → {string}
SHA1
Parameters:
Returns:
uuid() → {string}
生成GUID
Returns:
GUID
validPassword(password) → {boolean}
validPassword
Parameters:
输入密码
Returns:
isValid