{"id":18980447,"url":"https://github.com/ecollect/distributed-id-generator","last_synced_at":"2025-11-10T20:04:54.777Z","repository":{"id":57213093,"uuid":"137983010","full_name":"eCollect/distributed-id-generator","owner":"eCollect","description":"Prefixed id generator over distributed services","archived":false,"fork":false,"pushed_at":"2023-02-09T16:13:06.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-18T02:39:15.478Z","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/eCollect.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-20T05:11:50.000Z","updated_at":"2023-02-08T10:06:17.000Z","dependencies_parsed_at":"2024-09-25T15:08:41.683Z","dependency_job_id":"6446c13c-558e-4b24-b08f-9536d3295b79","html_url":"https://github.com/eCollect/distributed-id-generator","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":"0.16000000000000003","last_synced_commit":"534308f10280eaa05dc709216608aa8a27f39fd7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fdistributed-id-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fdistributed-id-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fdistributed-id-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fdistributed-id-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eCollect","download_url":"https://codeload.github.com/eCollect/distributed-id-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985731,"owners_count":19729515,"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-11-08T16:06:50.556Z","updated_at":"2025-11-10T20:04:54.697Z","avatar_url":"https://github.com/eCollect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# distributed-id-generator v0.6.1\n\nSystem wide singleton distributed ID generator.\n\nThe library contains the following module groups :\n+ Hashing algorithms ( Base32, node-fe1-fpe )\n+ Checksum generation and validation ( Modified )\n+ ID Generation and validation logic.\n+ Guardstore implementation - Redis backend to ensure consistent distributed ID generation\n\nCurrently two types of IDs are supported, strictly numeric or base32 alpha-numeric ones.\n\n## Usage guidelines \n\nTo avoid id format errors and ensure consistency between system services all external usage of the library should be through the definitions found here, after configuring the guardstore.\n\nExample : \n```javascript\n\tconst path = require('path');\n\tconst DistributedIdGenerator = require('distributed-id-generator');\n\n\tconst idGenerator = DistributedIdGenerator.configureGuardstore({ // Redis optional settings\n\t\thost: 'localhost', // default\n\t\tport: 6379, // default\n\t\tdb: 1, // default\n\t\tprefix: 'id-guard-store', // default\n\t}).loadDefinitions(path.join(process.cwd(), './app/ids/'));\n```\n\nDefining Ids :\n```javascript\n\tconst { IdDefinition } = require('distributed-id-generator');\n\n\t// name, length including checksum, prefix, algorith either numeric or base32\n\tmodule.exports = new IdDefinition('account', 8, 'acc', 'base32');\n```\n\nDefinition that is based on another :\n```javascript\n\tconst accountIdDefinition = require('./account');\n\n\t// this will produce ids that are : cus-XXXXXXXX-XXXXXXXX\n\tmodule.exports = accountIdDefinition.extend('customer', 8, 'cus', 'base32');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecollect%2Fdistributed-id-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecollect%2Fdistributed-id-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecollect%2Fdistributed-id-generator/lists"}