{"id":19228940,"url":"https://github.com/heppu/binary-pad","last_synced_at":"2025-07-21T16:37:01.467Z","repository":{"id":84341720,"uuid":"63192806","full_name":"heppu/binary-pad","owner":"heppu","description":"Zero padding for binary format","archived":false,"fork":false,"pushed_at":"2016-07-12T21:57:24.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-04T22:45:08.059Z","etag":null,"topics":["formatter","go"],"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/heppu.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":"2016-07-12T21:15:21.000Z","updated_at":"2016-07-12T21:58:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c0c8108-127c-4d81-b6d6-bd0128703e78","html_url":"https://github.com/heppu/binary-pad","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/heppu%2Fbinary-pad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fbinary-pad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fbinary-pad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fbinary-pad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heppu","download_url":"https://codeload.github.com/heppu/binary-pad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240304572,"owners_count":19780312,"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":["formatter","go"],"created_at":"2024-11-09T15:31:09.161Z","updated_at":"2025-02-23T10:43:04.577Z","avatar_url":"https://github.com/heppu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero padding for binary format\n\nI often find myself writing zero padding when debugging binary data because comparing alligned binary strings in terminal is just easier than looking some messy binanry data.\n\n##Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/heppu/binary-pad\"\n\t\"math/rand\"\n\t\"time\"\n)\n\nconst BUF_LEN = 5\n\nfunc main() {\n\trand.Seed(time.Now().UnixNano())\n\tbuf := make([]byte, BUF_LEN)\n\treadBytesFromDevice(\u0026buf)\n\n\t// Print buffer zero padded\n\tfor _, v := range buf {\n\t\tfmt.Println(pad.Pad(v))\n\t}\n}\n\n// Fake reading data from device\nfunc readBytesFromDevice(b *[]byte) {\n\tfor i := 0; i \u003c BUF_LEN; i++ {\n\t\t(*b)[i] = byte(rand.Intn(int(^uint8(0))))\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fbinary-pad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheppu%2Fbinary-pad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fbinary-pad/lists"}