{"id":13777708,"url":"https://github.com/vislee/lua-resty-hyperloglog","last_synced_at":"2026-01-16T21:04:59.017Z","repository":{"id":78680458,"uuid":"374002897","full_name":"vislee/lua-resty-hyperloglog","owner":"vislee","description":"Hyperloglog for openresty.","archived":false,"fork":false,"pushed_at":"2021-06-05T07:30:17.000Z","size":67,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-15T02:32:00.026Z","etag":null,"topics":["hll","hyperloglog","lua-resty"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vislee.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}},"created_at":"2021-06-05T02:27:50.000Z","updated_at":"2023-09-28T05:51:11.000Z","dependencies_parsed_at":"2023-03-21T21:17:46.775Z","dependency_job_id":null,"html_url":"https://github.com/vislee/lua-resty-hyperloglog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vislee%2Flua-resty-hyperloglog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vislee%2Flua-resty-hyperloglog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vislee%2Flua-resty-hyperloglog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vislee%2Flua-resty-hyperloglog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vislee","download_url":"https://codeload.github.com/vislee/lua-resty-hyperloglog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253559235,"owners_count":21927553,"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":["hll","hyperloglog","lua-resty"],"created_at":"2024-08-03T18:00:47.543Z","updated_at":"2026-01-16T21:04:58.975Z","avatar_url":"https://github.com/vislee.png","language":"Lua","readme":"# lua-resty-hyperloglog\n\n`lua-resty-hyperloglog` is hyperloglog for openresty.\n\nTable of Contents\n=================\n* [Status](#status)\n* [Synopsis](#Synopsis)\n* [Methods](#methods)\n    * [new](#new)\n    * [insert](#insert)\n    * [count](#count)\n    * [merge](#merge)\n    * [close](#close)\n* [Author](#author)\n* [Copyright and License](#copyright-and-license)\n\nStatus\n======\n\nThis library is still under early development and is still experimental.\n\nSynopsis\n========\n\n```nginx\n\nhttp {\n\n    ...\n\n    lua_shared_dict hll_count 10m;\n\n    init_by_lua_block {\n        local hll = require \"resty.hyperloglog\"\n        h = hll.new(\"hll_count\", 12)\n    }\n\n    server {\n        listen 8080;\n\n        location / {\n            access_by_lua_block {\n                h:insert(ngx.var.uri)\n            }\n\n            ...\n        }\n\n        location = /stats {\n            content_by_lua_block {\n                ngx.print(\"count:\", h:count())\n                ngx.exit(ngx.HTTP_OK)\n            }\n        }\n    }\n}\n\n\n```\n\n[Back to TOC](#table-of-contents)\n\nMethods\n=======\n\nnew\n---\n`syntax: h, err = hll.new(name, log2m)`\n\nCreate a hyperloglog object with 2^log2m bucket. Returns `nil` on error.\n\n\ninsert\n------\n`syntax: h:insert(str)`\n\nInsert a string to hyperloglog object.\n\ncount\n-----\n`syntax: c = h:count()`\n\nReturns the cardinality of the hyperloglog object.\n\nmerge\n-----\n`syntax: ok, err = h:merge(h2)`\n\nMerge another hyperloglog object(h2) into h. Returns `false` on error.\n\nclose\n-----\n`syntax: h:close()`\n\nClose the hyperloglog object.\n\n\n[Back to TOC](#table-of-contents)\n\nAuthor\n======\n\nwenqiang li(vislee)\n\n[Back to TOC](#table-of-contents)\n\nCopyright and License\n=====================\n\nThis module is licensed under the BSD License.\n\nCopyright (C) by vislee.\n\nAll rights reserved.\n\n[Back to TOC](#table-of-contents)\n\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvislee%2Flua-resty-hyperloglog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvislee%2Flua-resty-hyperloglog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvislee%2Flua-resty-hyperloglog/lists"}