Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@4a/cid

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

@4a/cid

unique-integer-id,数字id,常用于生成订单号,流水单号

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
increased by40%
Maintainers
1
Weekly downloads
 
Created
Source

unique-integer-id

数字ID,常用于订单号,流水号等常见数字ID场景

Install

npm i @4a/cid

Usage

const cid = require('@4a/cid')

// 默认长度26
cid()   // 20072418073123028206226431
cid(36) // 200724180731230341096740207611144342
cid(24) // 设置长度24 推荐QPS低于10万
cid(26) // 设置长度26 推荐QPS低于20万

Prefix

// 默认前缀取两位数年份
// 例如2021年,则前缀是21
// 同样可以自定义前缀,两位数

cid(26, { prefix: 10 })

Keywords

FAQs

Package last updated on 24 Jul 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

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