{"id":16947050,"url":"https://github.com/mainro/sysflake","last_synced_at":"2026-05-19T06:35:48.948Z","repository":{"id":34302283,"uuid":"38212327","full_name":"MainRo/sysflake","owner":"MainRo","description":"System unique id generator","archived":false,"fork":false,"pushed_at":"2017-05-25T20:50:13.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T09:18:56.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/MainRo.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}},"created_at":"2015-06-28T20:02:46.000Z","updated_at":"2023-09-08T16:59:08.000Z","dependencies_parsed_at":"2022-09-14T03:32:01.762Z","dependency_job_id":null,"html_url":"https://github.com/MainRo/sysflake","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MainRo/sysflake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainRo%2Fsysflake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainRo%2Fsysflake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainRo%2Fsysflake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainRo%2Fsysflake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MainRo","download_url":"https://codeload.github.com/MainRo/sysflake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainRo%2Fsysflake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33204730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"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":"2024-10-13T21:45:43.373Z","updated_at":"2026-05-19T06:35:48.933Z","avatar_url":"https://github.com/MainRo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SysFlake\n\nSysflake is a library that can be used to generate a system unique id. This\nlibrary can be used from command line via the \"sysflake\" tool, or from c code.\n\nSysflake is inspired from simpleflake, but adapted to generate runtime ids on\nstandalone linux systems. It runs in a library embedded in each process that\nneeds to generate ids. No deamon is running. Sysflake can generate 1024 unique\nids per thread per millisecond for more than 4 years.\n\n## When Can I Use Sysflake ?\n\nIf you need to generate a reasonable number of runtime unique ids on your system\nthen sysflake can be a solution.\n\n## When Should I NOT Use Sysflake ?\n\nIf you need persitant unique ids, unique ids between several devices, ids that\nmust be hard to guess form a security point of view, then sysflake is not the\ntool you need.\n\nif you need to generate more than 1024 ids per millisecond from the same thread\nthen sysflake is not the tool you need.\n\nIf you increased the default value of \"/proc/sys/kernel/pid_max\" on a 64 bits\nlinux kernel, sysflake does not work.\n\n# Specification\n\nA flake is encoded as a 64 bits signed integer (int64_t). Its content is built\nfrom the following information:\n\n    +-----------+--------+---------+\n    | timestamp | thread | counter |\n    +-----------+--------+---------+\n\n- timestamp is a 37 bits milli-seconds time.\n- thread is the 17 bits linux thread id.\n- counter is a 10 bits counter to ensure id uniqueness within a milli-second.\n\n# Usage\n\n## From Command Line\n\nyou can use sysflake from script via the sysflake tool:\n\n    $ sysflake\n    002906A15CABF400\n\n## From C Code\n\n    #include \"sysflake.h\"\n\n    void foo(void)\n    {\n        int64_t flake = sysflake_generate();\n    }\n\nIn case or error, sysflake_generate returns 0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainro%2Fsysflake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmainro%2Fsysflake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainro%2Fsysflake/lists"}