{"id":18249376,"url":"https://github.com/adamorgan/snowflakes","last_synced_at":"2025-04-08T20:20:58.541Z","repository":{"id":255930415,"uuid":"853905073","full_name":"AdaMorgan/snowflakes","owner":"AdaMorgan","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-08T14:14:41.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T15:50:04.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/AdaMorgan.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":"2024-09-07T21:29:37.000Z","updated_at":"2024-09-08T14:14:44.000Z","dependencies_parsed_at":"2024-09-07T23:23:32.760Z","dependency_job_id":"07294e23-49c4-496b-a250-58cbd44cb582","html_url":"https://github.com/AdaMorgan/snowflakes","commit_stats":null,"previous_names":["adamorgan/snowflakes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaMorgan%2Fsnowflakes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaMorgan%2Fsnowflakes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaMorgan%2Fsnowflakes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaMorgan%2Fsnowflakes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdaMorgan","download_url":"https://codeload.github.com/AdaMorgan/snowflakes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247919210,"owners_count":21018076,"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-05T09:39:52.398Z","updated_at":"2025-04-08T20:20:58.506Z","avatar_url":"https://github.com/AdaMorgan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snowflakes\nThese IDs are guaranteed to be unique across, except in some unique scenarios in which child objects share their parent's ID. Because Snowflake IDs are up to 64 bits in size (e.g. a uint64), they are always returned as strings in the HTTP API to prevent integer overflows in some languages.\n\n#### Snowflake ID Broken Down in Binary\n\n```\n111111111111111111111111111111111111111111 11111 11111 111111111111\n64                                         22    17    12          0\n```\n\n#### Snowflake ID Format Structure (Left to Right)\n\n| Field               | \tBits     | \tNumber of bits | \tDescription                                                                  | \tRetrieval                         |\n|---------------------|-----------|-----------------|-------------------------------------------------------------------------------|------------------------------------|\n| Timestamp           | \t63 to 22 | \t42 bits        | \tMilliseconds since Epoch, the first second of 2015 or 1420070400000.         | \t(snowflake \u003e\u003e 22) + 1420070400000 |\n| Internal worker ID  | \t21 to 17 | 5 bits          |                                                                               | (snowflake \u0026 0x3E0000) \u003e\u003e 17       |\n| Internal process ID | 16 to 12  | \t5 bits\t\t       |                                                                               | (snowflake \u0026 0x1F000) \u003e\u003e 12        |\n| Increment           | \t11 to 0  | \t12 bits        | \tFor every ID that is generated on that process, this number is incremented   | \tsnowflake \u0026 0xFFF                 |\n\n\n#### Convert Snowflake to DateTime\n\n#### Snowflake IDs in Pagination\n\nWe typically use snowflake IDs in many of our API routes for pagination. The standardized pagination paradigm we utilize is one in which you can specify IDs **before** and **after** in combination with **limit** to retrieve a desired page of results. You will want to refer to the specific endpoint documentation for details.\n\nIt is useful to note that snowflake IDs are just numbers with a timestamp, so when dealing with pagination where you want results from the beginning of time (in Epoch, but **0** works here too) or before/after a specific time you can generate a snowflake ID for that time.\n\n#### Generating a snowflake ID from a Timestamp Example\n\n```\n(timestamp_ms - EPOCH) \u003c\u003c 22\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamorgan%2Fsnowflakes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamorgan%2Fsnowflakes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamorgan%2Fsnowflakes/lists"}