{"id":13411354,"url":"https://github.com/iancmcc/bingo","last_synced_at":"2026-01-12T01:02:25.095Z","repository":{"id":44560080,"uuid":"398691869","full_name":"iancmcc/bingo","owner":"iancmcc","description":"Fast, zero-allocation, lexicographic-order-preserving packing/unpacking of native Go types to bytes.","archived":false,"fork":false,"pushed_at":"2024-06-15T21:20:40.000Z","size":75,"stargazers_count":36,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-31T20:45:36.881Z","etag":null,"topics":[],"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/iancmcc.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":"2021-08-22T01:48:48.000Z","updated_at":"2024-06-19T12:33:11.000Z","dependencies_parsed_at":"2024-06-19T06:30:02.708Z","dependency_job_id":null,"html_url":"https://github.com/iancmcc/bingo","commit_stats":null,"previous_names":["iancmcc/keypack"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/iancmcc/bingo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iancmcc%2Fbingo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iancmcc%2Fbingo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iancmcc%2Fbingo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iancmcc%2Fbingo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iancmcc","download_url":"https://codeload.github.com/iancmcc/bingo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iancmcc%2Fbingo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28330153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-07-30T20:01:13.102Z","updated_at":"2026-01-12T01:02:25.075Z","avatar_url":"https://github.com/iancmcc.png","language":"Go","funding_links":[],"categories":["数据结构与算法","Data Structures","Uncategorized","Data Structures and Algorithms","Generators","Data Integration Frameworks"],"sub_categories":["Bit-packing和压缩","Standard CLI","Uncategorized","Bit-packing and Compression"],"readme":"# bingo\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/iancmcc/bingo?style=flat-square)](https://goreportcard.com/report/github.com/iancmcc/bingo)\n[![Go Reference](https://pkg.go.dev/badge/github.com/iancmcc/bingo.svg)](https://pkg.go.dev/github.com/iancmcc/bingo)\n![Tests](https://github.com/iancmcc/bingo/actions/workflows/tests.yml/badge.svg)\n[![Coverage](https://coveralls.io/repos/github/iancmcc/bingo/badge.svg?branch=main)](https://coveralls.io/github/iancmcc/bingo?branch=main)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\nFast, zero-allocation, lexicographic-order-preserving packing/unpacking of native Go types to bytes.\n\n## Features\n\n* Encode `bool`, `string`, `int8`, `int16`, `int32`, `int64`, `uint8`, `uint16`, `uint32`, `uint64`, `float32`, `float64`, and `time.Time`\n* Packed values maintain original sort order\n* Pack values in descending order\n* Pack to an existing byte slice with no additional allocations\n* Create and pack values to a new byte slice (one allocation)\n* Unpack all values or just specific indexes\n\n## Usage\n\nImport `bingo`:\n\n```go\nimport \"github.com/iancmcc/bingo\"\n```\n\n### Packing\n\n```go\n// Create and return a byte slice with encoded values\nkey := bingo.MustPack(uint8(12), \"cool string bro\")\n\n// Now unpack\nvar (\n    first uint8\n    second string\n)\nbingo.Unpack(key, \u0026first, \u0026second)\n\n\n// Pack so results will sort the second value descending\nkey = bingo.WithDesc(false, true, false).MustPack(1, time.Now(), true)\n\n// Just unpack the middle value\nvar t time.Time\nbingo.UnpackIndex(key, 1, \u0026t)\n\n\n// Pack to an existing byte slice\nexistingSlice := make([]byte, 100)\nbingo.MustPackTo(existingSlice, uint16(7), \"abc123\")\n```\n\n## Benchmarks\n\n```sh\n$ go test -bench BenchmarkCodecs\n```\n\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/iancmcc/bingo\ncpu: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz\nBenchmarkCodecs/int8/encode/natural-8         \t100000000\t        10.35 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int8/encode/inverse-8         \t89794872\t        12.60 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int8/decode/natural-8         \t65864187\t        17.11 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int8/decode/inverse-8         \t63386660\t        17.27 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int16/encode/natural-8        \t100000000\t        10.04 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int16/encode/inverse-8        \t85618111\t        13.08 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int16/decode/natural-8        \t64825372\t        16.55 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int16/decode/inverse-8        \t58359490\t        19.44 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int32/encode/natural-8        \t120393369\t         9.942 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int32/encode/inverse-8        \t80418766\t        13.67 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int32/decode/natural-8        \t53423986\t        21.03 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int32/decode/inverse-8        \t47975257\t        24.68 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int64/encode/natural-8        \t100000000\t        10.95 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int64/encode/inverse-8        \t67093402\t        17.79 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int64/decode/natural-8        \t47149765\t        23.97 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/int64/decode/inverse-8        \t39063907\t        27.36 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float32/encode/natural-8      \t100000000\t        10.42 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float32/encode/inverse-8      \t79910834\t        14.11 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float32/decode/natural-8      \t63494347\t        16.88 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float32/decode/inverse-8      \t46677241\t        25.55 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float64/encode/natural-8      \t100000000\t        11.05 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float64/encode/inverse-8      \t62377978\t        17.48 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float64/decode/natural-8      \t62370994\t        17.26 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/float64/decode/inverse-8      \t54139144\t        20.68 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/string/encode/natural-8       \t47404435\t        23.80 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/string/encode/inverse-8       \t29144544\t        39.74 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/string/decode/natural-8       \t39683684\t        31.39 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/string/decode/inverse-8       \t23373333\t        48.06 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/time/encode/natural-8         \t47027752\t        24.72 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/time/encode/inverse-8         \t38363001\t        29.22 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/time/decode/natural-8         \t42566337\t        26.76 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCodecs/time/decode/inverse-8         \t30851250\t        36.88 ns/op\t       0 B/op\t       0 allocs/op\nPASS\nok  \tgithub.com/iancmcc/bingo\t37.644s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiancmcc%2Fbingo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiancmcc%2Fbingo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiancmcc%2Fbingo/lists"}