{"id":13437250,"url":"https://github.com/sitkevij/hex","last_synced_at":"2025-05-16T00:05:44.065Z","repository":{"id":31113064,"uuid":"125088512","full_name":"sitkevij/hex","owner":"sitkevij","description":"🔮 Futuristic take on hexdump, made in Rust. ","archived":false,"fork":false,"pushed_at":"2024-06-09T18:12:44.000Z","size":290,"stargazers_count":541,"open_issues_count":1,"forks_count":30,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-09T15:52:41.213Z","etag":null,"topics":["ascii","binary-data","bytes","developer-tools","hex","hexadecimal","hexdump","rust","xxd"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sitkevij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-03-13T17:20:36.000Z","updated_at":"2025-04-29T05:25:34.000Z","dependencies_parsed_at":"2024-06-19T03:03:36.514Z","dependency_job_id":null,"html_url":"https://github.com/sitkevij/hex","commit_stats":{"total_commits":93,"total_committers":11,"mean_commits":8.454545454545455,"dds":0.4946236559139785,"last_synced_commit":"21b2304a1f8ba43e9fbafd4881ac61d39ad49042"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fhex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fhex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fhex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fhex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitkevij","download_url":"https://codeload.github.com/sitkevij/hex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"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":["ascii","binary-data","bytes","developer-tools","hex","hexadecimal","hexdump","rust","xxd"],"created_at":"2024-07-31T03:00:55.401Z","updated_at":"2025-05-16T00:05:44.045Z","avatar_url":"https://github.com/sitkevij.png","language":"Rust","readme":"# hex (hx)\n\nFuturistic take on hexdump.\n\n[hx](https://github.com/sitkevij/hex) accepts a file path or stdin as input and outputs\na hexadecimal colorized view to stdout.\n\n[hx](https://github.com/sitkevij/hex) with file path as input, outputting colorized hexadecimal:\n\n```sh\n$ hx tests/files/alphanumeric.txt\n0x000000: 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a abcdefghij\n0x00000a: 0x6b 0x69 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 kilmnopqrs\n0x000014: 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x30 0x31 0x32 tuvwxyz012\n0x00001e: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x0a 0x30 0x31 3456789.01\n0x000028: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x31 2345678901\n0x000032: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x31 2345678901\n0x00003c: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39           23456789\n   bytes: 68\n```\n\n[hx](https://github.com/sitkevij/hex) with stdin as input, outputting colorized hexadecimal:\n\n```sh\ncat tests/files/alphanumeric.txt | hx\n0x000000: 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a abcdefghij\n0x00000a: 0x6b 0x69 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 kilmnopqrs\n0x000014: 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x30 0x31 0x32 tuvwxyz012\n0x00001e: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x0a 0x30 0x31 3456789.01\n0x000028: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x31 2345678901\n0x000032: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x31 2345678901\n0x00003c: 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39           23456789\n   bytes: 68\n```\n\n[![crates.io](https://img.shields.io/crates/v/hx.svg)](https://crates.io/crates/hx)\n[![build status](https://github.com/sitkevij/hex/workflows/ci/badge.svg)](https://github.com/sitkevij/hex/actions)\n\n## quick links\n\n- [examples](#examples)\n- [installation](#installation)\n- [features](#features)\n- [help](#help)\n- [license](#license)\n\n## examples\n\n### lower hex format -fx\n\n`$ hx src/main.rs`\n\n![lower hex output format](https://raw.githubusercontent.com/sitkevij/hex/master/assets/hex_screenshot_macos_format_default.png \"default output format\")\n\n### binary hex format -fb\n\n`$ hx -fb -c4 src/main.rs`\n\n![binary hex output format](https://raw.githubusercontent.com/sitkevij/hex/master/assets/hex_screenshot_macos_format_b.png)\n\n### octal hex format -fo\n\n`$ hx -fo -c8 src/main.rs`\n\n![octal hex output format](https://raw.githubusercontent.com/sitkevij/hex/master/assets/hex_screenshot_macos_format_o.png)\n\n## installation\n\n### packaging availability\n\n`hx` is packaged and available for install on the following platforms:\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/hx-hexdump.svg)](https://repology.org/project/hx-hexdump/versions)\n\n### crates.io install\n\nIf `cargo` is already installed, simply:\n\n```sh\ncargo install hx\n```\n\n### source install\n\nFrom within the `hx` source code directory, simply execute:\n\n```sh\nmake install\n```\n\nThis will run the following `cargo` commands:\n\n```sh\ncargo build --release\ncargo test --verbose --all -- --nocapture\ncargo install --path .\n```\n\nWhich will compile the release version, run tests and install release binary to `\u003cUSERDIR\u003e/.cargo/bin/hx`.\n\nIf `\u003cUSERDIR\u003e/.cargo/bin` is part of the `PATH` environment variable, `hx` should be able\nexecutable anywhere in the shell.\n\n### arch linux install\n\n```sh\npacman -S hex\n```\n\n### debian install\n\nBrowse https://github.com/sitkevij/hex/releases/latest to choose `VERSION` for use with this debian\ninstallation example:\n\n```sh\nVERSION=0.6.0 \u0026\u0026 curl -sLO \"https://github.com/sitkevij/hex/releases/download/v$VERSION/hx_$VERSION-1_amd64.deb\" \u0026\u0026 dpkg -i \"hx_$VERSION-1_amd64.deb\"\n```\n\n### guix install\n\n```sh\nguix install hex\n```\n\nIn an isolated environment:\n\n```sh\nguix shell --container hex\n```\n\n### docker run\n\n```sh\n# stdin\ncat README.md | docker run -ti sitkevij/hx:latest\n\n# file input with parameters and NO_COLOR environment variable\necho \"NO_COLOR=1\" \u003edocker_env_vars.ignore.txt \u0026\u0026\ndocker run -ti --env-file docker_env_vars.ignore.txt -v $(pwd)/README.md:/README.md sitkevij/hx:latest -fo -c8 /README.md\n```\n\n## features\n\n### output arrays in `rust`, `c`, `golang`, `python`, `fsharp`, `kotlin`, `java`, or `swift`\n\n`hx` has a feature which can output the input file bytes as source code arrays.\n\nFor example:\n\n#### rust array: -ar\n\n```sh\n$ hx -ar -c8 tests/files/tiny.txt\nlet ARRAY: [u8; 3] = [\n    0x69, 0x6c, 0x0a\n];\n```\n\n#### c array: -ac\n\n```sh\n$ hx -ac -c8 tests/files/tiny.txt\nunsigned char ARRAY[3] = {\n    0x69, 0x6c, 0x0a\n};\n```\n\n#### golang array: -ag\n\n```sh\n$ hx -ag -c8 tests/files/tiny.txt\na := [3]byte{\n    0x69, 0x6c, 0x0a,\n}\n```\n\n#### python array: -ap\n\n```sh\n$ hx -ap -c8 tests/files/tiny.txt\na = [\n    0x69, 0x6c, 0x0a\n]\n```\n\n#### kotlin array: -ak\n\n```sh\n$ hx -ak -c8 tests/files/tiny.txt\nval a = byteArrayOf(\n    0x69, 0x6c, 0x0a\n)\n```\n\n#### java array: -aj\n\n```sh\n$ hx -aj -c8 tests/files/tiny.txt\nbyte[] a = new byte[]{\n    0x69, 0x6c, 0x0a\n};\n```\n\n#### swift array: -as\n\n```sh\n$ hx -as -c8 tests/files/tiny.txt\nlet a: [UInt8] = [\n    0x69, 0x6c, 0x0a\n]\n```\n\n#### fsharp array: -af\n\n```sh\n$ hx -af -c8 tests/files/tiny.txt\nlet a = [|\n    0x69uy; 0x6cuy; 0x0auy\n|]\n```\n\n### NO_COLOR support\n\n`hx` will honor the NO_COLOR environment variable. If set, no color will be output to the terminal.\n\nRust `no_color` crate:\n\n- \u003chttps://crates.io/crates/no_color\u003e\n- \u003chttps://github.com/sitkevij/no_color\u003e\n\n## help\n\n```txt\nhx\nFuturistic take on hexdump, made in Rust.\n\nUSAGE:\n    hx [OPTIONS] [INPUTFILE]\n    \u003cstdout\u003e | hx [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -a, --array \u003carray_format\u003e    Set source code format output: rust (r), C (c), golang (g), python (p), kotlin (k),\n                                  java (j), swift (s), fsharp (f) [possible values: r, c, g, p, k, j, s, f]\n    -t, --color \u003ccolor\u003e           Set color tint terminal output. 0 to disable, 1 to enable [possible values: 0, 1]\n    -c, --cols \u003ccolumns\u003e          Set column length\n    -f, --format \u003cformat\u003e         Set format of octet: Octal (o), LowerHex (x), UpperHex (X), Binary (b) [possible\n                                  values: o, x, X, b]\n    -u, --func \u003cfunc_length\u003e      Set function wave length\n    -l, --len \u003clen\u003e               Set \u003clen\u003e bytes to read\n    -p, --places \u003cfunc_places\u003e    Set function wave output decimal places\n\nARGS:\n    \u003cINPUTFILE\u003e    Pass file path as an argument, or input data may be passed via stdin\n```\n\n## license\n\nMIT\n","funding_links":[],"categories":["应用","Applications","Rust","应用程序 Applications","应用 Applications","HarmonyOS","rust","File","Other"],"sub_categories":["System tools","系统工具 System tools","系统工具","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitkevij%2Fhex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitkevij%2Fhex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitkevij%2Fhex/lists"}