🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

dwing-common

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dwing-common

Node.js 通用类

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

dwing-Common

npm npm

安装

npm install dwing-common --save

使用

ES7:

import {md5} from 'dwing-common';

console.log(md5('1'));

Methods

getDefer() → {Promise.defer}

getDefer

Source:
  • index.js, line 56
Returns:

defer对象

Type
Promise.defer

getTimestamp() → {int}

获取UNIX标准时间戳

Source:
Returns:

UNIX标准时间戳

Type
int

int2ip(num) → {string}

INT2IP

Parameters:
NameTypeDescription
`num`int

IP数值

Source:
Returns:

IP地址,如1.2.3.4

Type
string

ip2int(ip) → {number}

IP2INT

Parameters:
NameTypeDescription
`ip`str

IP地址,如1.2.3.4

Source:
Returns:

IP数值

Type
number

isEmpty(obj) → {boolean}

判断是否为空

Parameters:
NameTypeDescription
`obj`*

任意

Source:
Returns:

真为空,假为非空

Type
boolean

md5(str) → {string}

MD5

Parameters:
NameTypeDescription
`str`string
Source:
Returns:
Type
string

randStr(len) → {string}

随机字符串

Parameters:
NameTypeDescription
`len`int

字符串长度

Source:
Returns:
Type
string

sha1(str) → {string}

SHA1

Parameters:
NameTypeDescription
`str`string
Source:
Returns:
Type
string

sha1(str) → {string}

SHA1

Parameters:
NameTypeDescription
`str`string
Source:
Returns:
Type
string

uuid() → {string}

生成GUID

Source:
Returns:

GUID

Type
string

validPassword(password) → {boolean}

validPassword

Parameters:
NameTypeDescription
`password`string

输入密码

Source:
Returns:

isValid

Type
boolean

Keywords

api

FAQs

Package last updated on 08 May 2017

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