{"id":36584665,"url":"https://github.com/mic90/go-binproto","last_synced_at":"2026-01-12T08:02:05.225Z","repository":{"id":57609789,"uuid":"121015781","full_name":"mic90/go-binproto","owner":"mic90","description":"Binary protocol using COBS + CRC16","archived":false,"fork":false,"pushed_at":"2018-09-03T16:41:14.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T15:21:08.726Z","etag":null,"topics":["binary-protocol","cobs","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mic90.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":"2018-02-10T13:01:24.000Z","updated_at":"2018-09-03T16:41:16.000Z","dependencies_parsed_at":"2022-08-27T11:33:17.497Z","dependency_job_id":null,"html_url":"https://github.com/mic90/go-binproto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mic90/go-binproto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic90%2Fgo-binproto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic90%2Fgo-binproto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic90%2Fgo-binproto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic90%2Fgo-binproto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mic90","download_url":"https://codeload.github.com/mic90/go-binproto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic90%2Fgo-binproto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"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":["binary-protocol","cobs","go","golang"],"created_at":"2026-01-12T08:01:08.570Z","updated_at":"2026-01-12T08:02:05.218Z","avatar_url":"https://github.com/mic90.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-binproto \n\n[![Build Status](https://travis-ci.org/mic90/go-binproto.svg?branch=master)](https://travis-ci.org/mic90/go-binproto)\n[![go report card](https://goreportcard.com/badge/github.com/mic90/go-binproto)](https://goreportcard.com/report/github.com/mic90/go-binproto)\n[![coverage](https://gocover.io/_badge/github.com/mic90/go-binproto)](https://gocover.io/github.com/mic90/go-binproto)\n[![godocs](https://godoc.org/github.com/mic90/go-binproto?status.svg)](https://godoc.org/github.com/mic90/go-binproto) \n\nThis package provides simple binary protocol implementation in Golang. \n\nThe protocol is intended to be used on low-memory devices, like MIPS processors, so it's written in such a manner to maintan low memory-usage and minimize memory reallocation between operations.\n\n## How it works ##\nProtocol uses COBS encoding with Fletcher CRC16 checksum. Source message is first concatenated with its checksum and then encoded using COBS.\n\nThanks to the used encoding method, the resulting data contains only one '0' sign - at the frame end, so it's easy to check where each frame is ending.\n\n## Memory usage ##\nLibrary contains internal memory buffer to which the encoded/decoded messages are written, so each call to encode or decode will overwrite last data. \n\nInternal memory buffer will grow only if its required to store a message bigger than its current length.\n\nTo obtain a copy of the last result use the **Copy** method. !This method will allocate new memory for the result data on each call!.\n\n```bash\nBenchmarkCache_Encode-4             \t100000000\t        14.5 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCache_Decode-4             \t100000000\t        15.5 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBinProto_Encode-4          \t20000000\t        73.3 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBinProto_Decode-4          \t20000000\t        69.2 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCobsEncode-4               \t100000000\t        21.2 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkCobsDecode-4               \t100000000\t        17.3 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkFletcher16-4               \t100000000\t        21.5 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkWriteReadShouldSucceed-4   \t5000000\t                313  ns/op\t       0 B/op\t       0 allocs/op\n```\n\n## Thread safety ##\nCurrently this library is not thread-safe, but it should be fairly easy to implement using for example mutexes.\n\n## Usage ##\n```golang\nproto := NewBinProto()\nsrc := []byte{1, 1, 1, 0, 0, 1, 5, 12, 44}\nencoded, _ := proto.Encode(src)\n// to save data for later use\nencodedCopy := proto.Copy()\n...\ndecoded, _ := proto.Decode(encodedCopy)\n// to save data for later use\ndecodedCopy := proto.Copy()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic90%2Fgo-binproto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmic90%2Fgo-binproto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic90%2Fgo-binproto/lists"}