{"id":15914576,"url":"https://github.com/bbengfort/binutil","last_synced_at":"2025-04-03T03:44:19.188Z","repository":{"id":174787768,"uuid":"652753595","full_name":"bbengfort/binutil","owner":"bbengfort","description":"Helpers for converting to and from binary and string representations","archived":false,"fork":false,"pushed_at":"2023-06-26T16:20:55.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-08T17:45:52.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbengfort.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":"2023-06-12T18:17:04.000Z","updated_at":"2023-06-12T20:32:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"bac9d3f9-f67b-4ae9-b895-673e6c030935","html_url":"https://github.com/bbengfort/binutil","commit_stats":null,"previous_names":["bbengfort/binutil"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fbinutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fbinutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fbinutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fbinutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbengfort","download_url":"https://codeload.github.com/bbengfort/binutil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933357,"owners_count":20857052,"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":[],"created_at":"2024-10-06T17:04:25.660Z","updated_at":"2025-04-03T03:44:19.162Z","avatar_url":"https://github.com/bbengfort.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# binutil\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bbengfort/binutil.svg)](https://pkg.go.dev/github.com/bbengfort/binutil)\n[![Tests](https://github.com/bbengfort/binutil/actions/workflows/test.yaml/badge.svg)](https://github.com/bbengfort/binutil/actions/workflows/test.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bbengfort/binutil)](https://goreportcard.com/report/github.com/bbengfort/binutil)\n\n**Helpers for converting to and from binary and string representations of data**\n\n## Installation\n\nThe simplest way to install the `binutil` command is to use [Homebrew](https://github.com/rotationalio/homebrew-tools) on Mac OS X:\n\n```\n$ brew install rotationalio/tools/binutil\n```\n\nIf you have Go v1.19 or later, you can install it directly to your `$GOBIN` as follows:\n\n```\n$ go install github.com/bbengfort/binutil/cmd/binutil@latest\n```\n\nFinally, you can manually download the appropriate binary from the [releases page](https://github.com/bbengfort/binutil/releases) and extract to a directory in your `$PATH` such as `~/bin`.\n\nOnce installed, make sure you can execute the `binutil` command as follows:\n\n```\n$ binutil --version\n```\n\n## Usage\n\nYou can use `binutil` to encode and decode binary strings from the command line. Basic usage is as follows:\n\n```\n$ binutil -d [DECODER] -e [ENCODER] [ENCODED BINARY DATA]\n```\n\nFor example, to convert base64 encoded data to hex encoded data:\n\n```\n$ binutil -d base64 -e hex nYOG+hjpWFAGJsaBoLrSeg==\n9d8386fa18e958500626c681a0bad27a\n```\n\nTo see a list of availabled decoders, use the `binutil decoders` command:\n\n```\n$ binutil decoders\nRegistered Decoders:\n====================\n- ascii\n- base64\n- base64-raw\n- base64-rawurl\n- base64-std\n- base64-url\n- hex\n- latin1\n- text\n- ulid\n- utf-8\n- uuid\n```\n\n**Note:** the above list may vary with new releases of `binutil`!\n\n### Generating Random Data\n\nYou can also quickly generate random data with the `binutil rand` command:\n\n```\n$ binutil rand -s 42 -e base64\ncdMvYhnbiMymr0zTFWpOcEnnhSQhFe4a+FvJu0p3aBYuAiVvqr8crwx7\n```\n\nThe `-s` specifies the size of the generated data by number of bytes.\n\nThis is useful for generating data for tests quickly.\n\n### Generating ULID and UUIDs\n\nOne important use case for `binutil` is to manage [ULID](https://github.com/oklog/ulid) and [UUID](https://github.com/google/uuid) in different binary formats (e.g. to insert data into a database via a SQL command). You can generate ULIDs and UUIDs as follows:\n\n```\n$ binutil ulid\n       ULID        01H3W76DQS0X8PX8ZT62MYAMD1\n       Time     2023-06-26T11:04:40.313-05:00\n  Hex Bytes  0188f87336f907516ea3fa30a9e551a1\n  b64 Bytes          AYj4czb5B1Fuo/owqeVRoQ==\n```\n\nThe output shows a variety of formats and the timestamp for ULIDs, allowing easy generation of conflict-free IDs for tests and fixtures. To easily copy and paste a UUID:\n\n```\n$ binutil uuid -e uuid -n | pbcopy\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fbinutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbengfort%2Fbinutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fbinutil/lists"}