@4a/cid 中文文档教程
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 })
更多
你可能也喜欢
- @0x/connect 中文文档教程
- @0xcda7a/redux-es6 中文文档教程
- @10play/phoenix-button 中文文档教程
- @4geit/swg-get-user-with-credentials-helper 中文文档教程
- @4geit/swg-reporter-helper 中文文档教程
- @_lukepatrick/postgraphile-upsert-plugin 中文文档教程
- @aaas/cli-logger 中文文档教程
- @abeai/node-redis 中文文档教程
- @abeai/sdk 中文文档教程
- @abhijithvijayan/eslint-config 中文文档教程