{"id":13411380,"url":"https://github.com/superwhiskers/crunch","last_synced_at":"2025-04-12T02:33:02.880Z","repository":{"id":57488451,"uuid":"172839693","full_name":"superwhiskers/crunch","owner":"superwhiskers","description":"take bytes out of things easily ✨🍪","archived":false,"fork":false,"pushed_at":"2023-01-14T03:01:28.000Z","size":297,"stargazers_count":95,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"canon","last_synced_at":"2024-07-31T20:45:43.379Z","etag":null,"topics":["bit-manipulation","byte-manipulation"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superwhiskers.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-27T03:56:52.000Z","updated_at":"2024-07-13T22:38:33.000Z","dependencies_parsed_at":"2023-02-09T18:45:26.885Z","dependency_job_id":null,"html_url":"https://github.com/superwhiskers/crunch","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superwhiskers%2Fcrunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superwhiskers%2Fcrunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superwhiskers%2Fcrunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superwhiskers%2Fcrunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superwhiskers","download_url":"https://codeload.github.com/superwhiskers/crunch/tar.gz/refs/heads/canon","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506935,"owners_count":21115511,"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":["bit-manipulation","byte-manipulation"],"created_at":"2024-07-30T20:01:13.275Z","updated_at":"2025-04-12T02:33:02.377Z","avatar_url":"https://github.com/superwhiskers.png","language":"Go","funding_links":[],"categories":["Data Structures","Data Structures and Algorithms","数据结构与算法","数据结构","数据结构`go语言实现的数据结构与算法`","Generators","Data Integration Frameworks","Uncategorized"],"sub_categories":["Advanced Console UIs","Standard CLI","Bit-packing and Compression","Bit-packing和压缩","标准 CLI"],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg height=\"340\" src=\"https://github.com/superwhiskers/crunch/raw/canon/.github/cookie.png\" alt=\"cookie with a bite taken out of it\"/\u003e\u003cbr /\u003ecrunch\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003ea library for easily manipulating bits and bytes in golang\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/superwhiskers/crunch/blob/canon/LICENSE.txt\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/license-MPL--2.0-brightgreen\" alt=\"license\" /\u003e\n\t\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/superwhiskers/crunch/v3\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/superwhiskers/crunch/v3.svg\" alt=\"documentation\" /\u003e\n  \u003c/a\u003e\n\t\u003ca href=\"https://github.com/superwhiskers/crunch/actions/workflows/go.yml\"\u003e\n\t\t\u003cimg src=\"https://github.com/superwhiskers/crunch/actions/workflows/go.yml/badge.svg\" alt=\"go\" /\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://goreportcard.com/report/github.com/superwhiskers/crunch\"\u003e\n\t\t\u003cimg src=\"https://goreportcard.com/badge/github.com/superwhiskers/crunch\" alt=\"go report card\" /\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://repl.it/github/https://github.com/superwhiskers/crunch?ref=button\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/try%20it%20on-repl.it-%2359646A.svg\" alt=\"try it on repl.it\" /\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"#features\"\u003efeatures\u003c/a\u003e | \u003ca href=\"#installation\"\u003einstallation\u003c/a\u003e | \u003ca href=\"#benchmarks\"\u003ebenchmarks\u003c/a\u003e | \u003ca href=\"#examples\"\u003eexamples\u003c/a\u003e\n\u003c/p\u003e\n\n## features\n\n- **feature-rich**: supports reading and writing integers of varying sizes in both little and big endian\n- **performant**: performs more than twice as fast as the standard library's `bytes.Buffer`\n- **simple and familiar**: has a consistent and easy-to-use api\n- **licensed under the mpl-2.0**: use it anywhere you wish, just don't change it privately\n\n## installation\n\n### install with the `go` tool\n\n```bash\n$ go get github.com/superwhiskers/crunch/v3\n```\n\nthen, just import it in your project like this. easy!\n\n```go\npackage \"yourpackage\"\n\nimport crunch \"github.com/superwhiskers/crunch/v3\"\n```\n\n### install using git submodules (not recommended)\n\n```bash\n# this assumes that you are in a git repository\n$ git submodule add https://github.com/superwhiskers/crunch path/to/where/you/want/crunch\n```\n\nthen, you can import it like this\n\n```go\npackage \"yourpackage\"\n\nimport crunch \"github.com/your-username/project/path/to/crunch/v3\"\n```\n\n## benchmarks\n\nboth `Buffer` and `MiniBuffer` perform on average more than twice as fast as `bytes.Buffer` in both writing and reading\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/superwhiskers/crunch/v3\ncpu: Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz\nBenchmarkBufferWriteBytes-4       \t612593820\t         1.948 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferReadBytes-4        \t1000000000\t         0.5476 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferWriteU32LE-4       \t125229171\t         9.528 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferReadU32LE-4        \t44677784\t        24.73 ns/op\t       8 B/op\t       1 allocs/op\nBenchmarkBufferReadBit-4          \t1000000000\t         0.5709 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferReadBits-4         \t620840577\t         1.869 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferSetBit-4           \t600202990\t         1.929 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferClearBit-4         \t625814206\t         1.993 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBufferGrow-4             \t252735192\t         6.638 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferWriteBytes-4   \t577940112\t         2.112 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferReadBytes-4    \t1000000000\t         0.5531 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferWriteU32LE-4   \t116178949\t        12.90 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferReadU32LE-4    \t189681555\t         6.296 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferWriteF32LE-4   \t121033429\t        13.06 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferReadF32LE-4    \t170977377\t         7.244 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferReadBit-4      \t1000000000\t         0.4730 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferReadBits-4     \t249350655\t         4.968 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferSetBit-4       \t566985802\t         2.173 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferClearBit-4     \t531134203\t         2.195 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMiniBufferGrow-4         \t271458589\t         4.434 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkStdByteBufferWrite-4     \t127322588\t         9.249 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkStdByteBufferRead-4      \t319744824\t         3.742 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkStdByteBufferGrow-4      \t274847331\t         4.367 ns/op\t       0 B/op\t       0 allocs/op\n```\n\n## examples\n\nexamples can be found in the [examples](https://github.com/superwhiskers/crunch/blob/canon/examples) directory\n\n## acknowledgements\n\nicon (cookie logo) made by [freepik](https://www.freepik.com/) from [flaticon.com](https://www.flaticon.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperwhiskers%2Fcrunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperwhiskers%2Fcrunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperwhiskers%2Fcrunch/lists"}