{"id":22433675,"url":"https://github.com/gavinning/unique-integer-id","last_synced_at":"2025-08-01T12:34:10.828Z","repository":{"id":57093677,"uuid":"282150502","full_name":"gavinning/unique-integer-id","owner":"gavinning","description":"数字ID，常用于生成订单号，流水单号","archived":false,"fork":false,"pushed_at":"2020-07-24T14:21:51.000Z","size":2,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T02:49:13.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavinning.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-24T07:17:01.000Z","updated_at":"2021-10-27T05:34:48.000Z","dependencies_parsed_at":"2022-08-22T21:40:22.465Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/unique-integer-id","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Funique-integer-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Funique-integer-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Funique-integer-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Funique-integer-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/unique-integer-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228377526,"owners_count":17910449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T22:15:38.142Z","updated_at":"2024-12-05T22:15:38.825Z","avatar_url":"https://github.com/gavinning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"unique-integer-id\n---\n数字ID，常用于订单号，流水号等常见数字ID场景\n\n### Install\n```sh\nnpm i @4a/cid\n```\n\n### Usage\n```js\nconst cid = require('@4a/cid')\n\n// 默认长度26\ncid()   // 20072418073123028206226431\ncid(36) // 200724180731230341096740207611144342\n```\n\n```js\ncid(24) // 设置长度24 推荐QPS低于10万\ncid(26) // 设置长度26 推荐QPS低于20万\n```\n\n### Prefix\n```js\n// 默认前缀取两位数年份\n// 例如2021年，则前缀是21\n// 同样可以自定义前缀，两位数\n\ncid(26, { prefix: 10 })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Funique-integer-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Funique-integer-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Funique-integer-id/lists"}