{"id":13777481,"url":"https://github.com/hqzxzb/lua-resty-unique-id","last_synced_at":"2025-05-11T11:33:38.119Z","repository":{"id":215839536,"uuid":"129740915","full_name":"hqzxzb/lua-resty-unique-id","owner":"hqzxzb","description":"Lua library for generating a unique ID for OpenResty","archived":false,"fork":false,"pushed_at":"2018-04-16T13:06:39.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-15T01:34:48.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hqzxzb.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}},"created_at":"2018-04-16T12:35:49.000Z","updated_at":"2024-08-03T18:10:51.061Z","dependencies_parsed_at":null,"dependency_job_id":"a35c0cd8-d03f-4148-a738-cb4dc4f78e86","html_url":"https://github.com/hqzxzb/lua-resty-unique-id","commit_stats":null,"previous_names":["hqzxzb/lua-resty-unique-id"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqzxzb%2Flua-resty-unique-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqzxzb%2Flua-resty-unique-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqzxzb%2Flua-resty-unique-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqzxzb%2Flua-resty-unique-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hqzxzb","download_url":"https://codeload.github.com/hqzxzb/lua-resty-unique-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253558910,"owners_count":21927508,"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-08-03T18:00:44.143Z","updated_at":"2025-05-11T11:33:37.832Z","avatar_url":"https://github.com/hqzxzb.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# lua-resty-unique-id\nLua library for generating a unique ID for OpenResty\n\n# Description\n\nThis Lua library is a unique ID generator in OpenResty. \n\nYou can use it to generate a unique ID that will not be duplicated for your OpenResty.\n\n# The Unique ID pattern generated by this library\n\n(13-bit millisecond-level timestamp)-(12-bit IP address)-(6-bit Nginx Worker PID)-(3 bit Nginx Worker number)-(6-bit auto-increasing random number)\n\nE.g : ```1523881864432-010020100149-087846-000-005964```\n\n# How to use\n\n1. Perform initialization in ```init_by_lua``` or ```init_by_lua_file``` :\n\n```lua\n--Load Unique ID library and initialize\nrequire(\"unique_id\");\nunique_id.init();\n```\n\n2. Use Unique ID library in your Lua script :\n\n```lua\nlocal id = unique_id.id();\n```\n\n# Test Results\n\n\u003e Test using Apache httpd ab tool\n\n---\n\n**Windows**\n\n**200000** requests and **500** concurrent\n\n**No duplicate value.**\n\n---\n\n**Linux**\n\n**200000** requests and **500** concurrent\n\n**No duplicate value.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqzxzb%2Flua-resty-unique-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhqzxzb%2Flua-resty-unique-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqzxzb%2Flua-resty-unique-id/lists"}