{"id":41756167,"url":"https://github.com/liangyaopei/hyper","last_synced_at":"2026-01-25T01:37:00.015Z","repository":{"id":57556953,"uuid":"284014979","full_name":"liangyaopei/hyper","owner":"liangyaopei","description":"Thread safe, concurrent used hyperloglog implemented in Golang, using murmur v3 hash function","archived":false,"fork":false,"pushed_at":"2020-07-31T14:08:09.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-29T09:18:08.875Z","etag":null,"topics":["algorithms","algorithms-and-data-structures","data-structures","golang","hyperloglog"],"latest_commit_sha":null,"homepage":"","language":"Go","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/liangyaopei.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":"2020-07-31T10:57:23.000Z","updated_at":"2024-04-25T02:57:48.000Z","dependencies_parsed_at":"2022-09-07T22:21:49.971Z","dependency_job_id":null,"html_url":"https://github.com/liangyaopei/hyper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liangyaopei/hyper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangyaopei%2Fhyper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangyaopei%2Fhyper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangyaopei%2Fhyper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangyaopei%2Fhyper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liangyaopei","download_url":"https://codeload.github.com/liangyaopei/hyper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangyaopei%2Fhyper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28740977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T01:25:41.653Z","status":"ssl_error","status_checked_at":"2026-01-25T01:25:34.364Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["algorithms","algorithms-and-data-structures","data-structures","golang","hyperloglog"],"created_at":"2026-01-25T01:36:59.946Z","updated_at":"2026-01-25T01:37:00.007Z","avatar_url":"https://github.com/liangyaopei.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/liangyaopei/hyper)](https://goreportcard.com/report/github.com/liangyaopei/hyper)\n[![GoDoc](https://godoc.org/github.com/liangyaopei/hyper?status.svg)](http://godoc.org/github.com/liangyaopei/hyper)\n\n# HyperLogLog\nHyperLogLog implementation in Golang, and it is thread-safe can be used concurrently.\nThe implementation borrows ideas from [wikipedia](https://en.wikipedia.org/wiki/HyperLogLog)  \n\n## Install\n```go\ngo get -u github.com/liangyaopei/hyper\n```\n## Example\n```go\nfunc TestHyperLogLog_Add(t *testing.T) {\n\tprecision := uint32(12)\n\trand.Seed(time.Now().UTC().UnixNano())\n\tfor i := 1; i \u003c= 20; i += 2 {\n\t\tn := 1 \u003c\u003c i\n\t\tres := make([]uint32, 0, n)\n\t\th := hyper.New(precision, false)\n\t\tfor j := 0; j \u003c n; j++ {\n\t\t\tnum := rand.Uint32()\n\t\t\tres = append(res, num)\n\t\t}\n\t\th.AddUint32Batch(res)\n\t\tcnt := h.Count()\n\t\tdiff := math.Abs(float64(n)-float64(cnt)) / float64(n)\n\t\tt.Logf(\"exact num:%10d,hyperloglog count:%10d,diff:%10f\", n, cnt, diff)\n\t}\n}\n```\n\n## Result\nFor adding 2,8,...524288 to hyperloglog,the result is as follow\n\n\n\n| number         | 2    | 8    | 32   | 128      |   512    | 2048     | 8192     | 32768    | 131072   | 524288   |\n| -------------- | ---- | ---- | ---- | -------- | :------: | -------- | -------- | -------- | -------- | -------- |\n| dirrerent rate | 0.00 | 0.00 | 0.00 | 0.007812 | 0.001953 | 0.001465 | 0.005981 | 0.002197 | 0.005287 | 0.000223 |\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangyaopei%2Fhyper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangyaopei%2Fhyper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangyaopei%2Fhyper/lists"}