{"id":50288690,"url":"https://github.com/codewithveek/green-auth","last_synced_at":"2026-05-28T04:04:22.262Z","repository":{"id":245382206,"uuid":"816906941","full_name":"codewithveek/green-auth","owner":"codewithveek","description":"An open-source web3 authentication","archived":false,"fork":false,"pushed_at":"2024-07-25T15:14:11.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-04T14:37:16.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewithveek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-06-18T16:14:57.000Z","updated_at":"2024-06-28T10:05:33.000Z","dependencies_parsed_at":"2024-06-25T03:00:11.718Z","dependency_job_id":"87479bc6-fe7b-4051-8783-d6767ade4345","html_url":"https://github.com/codewithveek/green-auth","commit_stats":null,"previous_names":["lucky-victory/green-auth","darkcodewrangler/green-auth","codewithveek/green-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codewithveek/green-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fgreen-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fgreen-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fgreen-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fgreen-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithveek","download_url":"https://codeload.github.com/codewithveek/green-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fgreen-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33593420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-05-28T04:04:15.504Z","updated_at":"2026-05-28T04:04:22.256Z","avatar_url":"https://github.com/codewithveek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# green-auth\n\nAn open-source web3 authentication\n\n# @green-auth/snowflake-unique-id\n\nA TypeScript implementation of Twitter's Snowflake ID generation algorithm with additional features for URL-safe short IDs.\n\n## Installation\n\n```bash\nnpm install @green-auth/snowflake-unique-id\n```\n\n## Usage\n\n### Basic Usage\n\n```ts\nimport { SnowflakeIdGenerator } from \"@green-auth/snowflake-unique-id\";\n\nconst generator = new SnowflakeIdGenerator({ nodeId: 1 });\n\n// Generate a BigInt ID\nconst bigIntId = generator.bigIntId();\nconsole.log(bigIntId); // e.g., \"459185200908210193\"\n\n// Generate a URL-safe short ID\nconst urlSafeId = generator.urlSafeId();\nconsole.log(urlSafeId); // e.g., \"aB3x_9Yz\"\n```\n\n## Custom configuration\n\n```ts\nconst customGenerator = new SnowflakeIdGenerator({\n  nodeId: 2,\n  epoch: 1672531200000, // Custom epoch (e.g., 2023-01-01)\n  nodeBits: 8,\n  sequenceBits: 14,\n  defaultShortIdLength: 10,\n});\n\nconst customUrlSafeId = customGenerator.urlSafeId(12);\nconsole.log(customUrlSafeId); // e.g., \"aBcDeF123456\"\n```\n\n## Types\n\n### SnowflakeOptions\n\noptions: An object with the following properties:\n\n- `nodeId` (required): number - Unique identifier for this generator instance (0 to 2^nodeBits - 1)\n- `epoch` (optional): number - Custom epoch in milliseconds (default: 1609459200000, 2021-01-01)\n- `nodeBits` (optional): number - Number of bits to use for node ID (default: 10)\n- `sequenceBits` (optional): number - Number of bits to use for sequence (default: 12)\n- `defaultShortIdLength` (optional): number - Default length for short IDs (default: 8)\n\n### Methods\n\n`bigIntId()`\nGenerates a unique BigInt ID.\n\n```ts\nbigIntId(): string\n```\n\nReturns: A string representation of the BigInt ID.\n\n`urlSafeId(length?: number)`\n\nGenerates a URL-safe unique ID.\n\n```ts\nurlSafeId(length?: number): string\n```\n\nParameters:\n\n- `length` (optional): number - The desired length of the URL-safe ID (default: value of defaultShortIdLength option)\n\nReturns: A URL-safe string ID.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithveek%2Fgreen-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithveek%2Fgreen-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithveek%2Fgreen-auth/lists"}